http://linux.vbird.org/linux_basic/0430cron.php
http://wiki.rubyonrails.org/rails/pages/runnerscript
crontab -e
0 12 * * 7 cd /home/your_name/your_rails_app/ && script/runner 'Record.weekly_report' -e development
Model, record.rb
def self.weekly_report
users = User.find(:all)
users.each do |u|
EbMail.deliver_weekly_report(u)
end
end
沒有留言:
張貼留言