How to stop cronjob from sending email every time it is executed

Written by
Date: 2012-04-28 14:25:07 00:00

Cronjob sends you email every time the job is executed by the cron daemon. The email contains the output of the task itself.

This can be very useful when you are debugging, but once everything is running OK it can be very annoying, specially if your cronjob is executed every few minutes.

If you need to stop cron from sending emails, just add this to the end of the line in cronjob file.

Edit that file with crontab -e and then add this to the end of the line: > /dev/null 2>&1

Something like this:

*/5 * * * * some_command > /dev/null 2>&1

OK, you are now safe of those annoying emails every 5 minutes.