How to stop those darn Cron emails
Problem
How to stop Cron related emails ? The alert emails i.e. root@<your_domain> are generated when cron has trouble runnning a particular script or command.
Solution #1
To stop just a particular script or command output you simply need to redirect the output to /dev/null. This can be done as follows :-
Show Plain TextText code
- * * * * * root /path/to/your_script &> /dev/null
- or
- * * * * * root /path/to/your_script > /dev/null 2>&1
After editing cron should automatically re-read the /etc/crontab file but you can force the reload with :-
Show Plain TextText code
- /etc/init.d/cron restart
Solution #2
To stop all emails being sent by cron simply set MAILTO="" at the start of your /etc/crontab file.