Multiple cronjob emails
I have 3 jobs in my crontab. I want to recieve emails if only 1 of them fails and not for other two. Is t开发者_C百科here any way to restric emails to one type of cronjob?
Redirect the output of the two you don't care about to /dev/null
if you don't ever want to see the output or to some file if you do.
Your cron likely supports this:
# This job produces mail.
* * * * * echo Hello
# These jobs do not.
MAILTO=
* * * * * echo Foo
* * * * * echo Bar
精彩评论