开发者

Multiple cronjob emails

开发者 https://www.devze.com 2023-01-20 11:22 出处:网络
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 t

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
0

精彩评论

暂无评论...
验证码 换一张
取 消