A few letters of cronjob

I have 3 vacancies in my crontab. I want to receive emails if only one of them fails, and not for the other two. Is there a way to limit email to one type of cronjob?

+5
source share
2 answers

Redirect the output of two that you don't like /dev/nullif you never want to see the output or any file if you do.

+9
source

Your cron probably supports this:

# This job produces mail.
* * * * * echo Hello

# These jobs do not.
MAILTO=
* * * * * echo Foo
* * * * * echo Bar
+3
source

All Articles