警告失败的 cron 作业

Alerting on a failed cron job

在 CentOS 7 EC2 实例上,无论出于何种原因可能无法执行的 cron 作业,是否有任何提醒?我正在寻找一种工具或审查任何其他人可能会用于此类事情的流程。

这里对您的问题有很好的回答:https://unix.stackexchange.com/questions/314640/how-to-make-cron-send-email-with-error-log-when-script-throws-errors

概括地说:

20 6-10 * * 1-5 ~/job_failure_test.sh > ~/job_fail.log 2>&1 || mail -s "Errors" myemail@something.com < ~/job_fail.log

但是请按照 link 解决问题,因为那里有一些很好的建议。