在服务器上,我们有以下cronfile:
MAILTO=admin_email@project.com
* * * * * /bin/bash -l -c 'cd /path/to/project/folder;RAILS_ENV=production bundle exec rake some_rake_task'
0 */2 * * * /bin/bash -l -c 'cd /path/to/project/folder;RAILS_ENV=production bundle exec rake another_rake_task'
# and so on
我将其移至whenever时没有任何问题:
config/schedule.rb
:
every '* * * * *' do
rake 'some_rake_task', output: 'log/cron.log'
end
every '0 */2 * * *' do
rake 'another_rake_task', output: 'log/cron.log'
end
# and so on
问题是如何在任何时候实施MAIL_TO选项,以便在出现任何问题时,管理员会收到通知?
谢谢!