multiple crontab jobs but only one of them should not send email

cron, email, linux, unix

Solution

See http://www.cyberciti.biz/faq/disable-the-mail-alert-by-crontab-command/

You could use something like

0 * * * * test3.sh >/dev/null 2>&1

There will be no output --> no mail sent.

Problem

I know that crontab job emails output of the job to its user. In my crontab file I have multiple jobs like: ``` 10 21 * * * test1.sh 13 21 * * * test2.sh 0 * * * * test3.sh ``` I don't want to receive email for test3.sh. Does below code works? I want to make sure that only for the last job I wont receive email. ``` 10 21 * * * test1.sh 13 21 * * * test2.sh MAILTO="" 0 * * * * test3.sh ```

Original source