Posts Tagged ‘debian’

Disable Cron Mail

March 8th, 2010

It’s a really fustrating feature , cron keeps sending mails with the output of every job it executes.
You can disable this per job by editing the crontab file (# crontab -e) and reddirecting the stdout (output messages) and/or stderr (error messages) to /dev/null.

for stdout:

0 * * * * /path/to/script.sh > /dev/null

for stdout and stderr:

0 * * * * /path/to/script.sh &> /dev/null

Or you can globally disable it with the MAILTO variable:

# echo 'MAILTO=""' >> /etc/default/cron