Monday, August 29, 2011

How to stop crontab writing to var/spool/mail/root file

My crontab is writing to /var/spool/mail/root file... Is there anyway I can stop this? The crontab is running every minute and it would fill the mail pretty quickly.

Can i see the crontab rule ?? you must of put to sent email to root
If use the crontab rule like in below example, it will not send any email

*/5 17,18 * * 1-5 / >/dev/null 2>&1
At the top of your crontab file just add:
This will disable mail sending by crond.

Recommended Solution:
Try to set that in the script itself rather than the whole crontab file