On server we have the following 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
I had no problems with moving it to 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
The question is how do I implement MAIL_TO option in whenever, so that when anything goes wrong admin is getting notified?
Thanks!