开发者

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
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜