Our company uses rails as our server, and we recycle tasks daily without monitoring. When the rake is interrupted, we cannot receive intermittent information until we find that our data is strange.
How can I get rake cancellation information as soon as possible via email or any other means?
You can try this stone - https://github.com/oscardelben/rake_notifier
Rake cron, MAILTO ( . man 5 crontab). cron , MAILTO.
man 5 crontab
, cron , , crontab ( , / ) script , .
crontab :
MAILTO=user@example.com # This should work if your crontab environment knows about Ruby and Rake. PATH=/path/to/ruby:$PATH GEM_PATH=/path/to/gems 0 0 * * * cd /path/to/project; rake foo # Otherwise, just create a shell script with a sane environment for running # rake tasks, and call your rake tasks from the script. 1 0 * * * /path/to/your/script.sh