Turn Off Cron Emails

Turn Off Cron Emails

Posted by: jonknee
Posted on: 2003-05-11 14:36:00

How can I turn off the Cron emails? I can make my script email me if something goes wrong... That's what I care about. I've been getting tons of mail that goes directly to the trash (made a rule). Just a waste.

Re: Turn Off Cron Emails

Posted by: will
Posted on: 2003-05-11 17:11:00

Just redirect stdout / stderr to the bit bucket so that the emails aren't sent at all. Something like this should work. See crontab(5) for more information (man 5 crontab).

Basically, you want something like this:
* * * * * /your/cron/job >/dev/null 2>&1

If you want to receive stderr, but not stdout, just do:
* * * * * /your/cron/job >/dev/null

A quick and dirty way to accomplish what you're trying to do would be to put:
MAILTO=""

Tags: cronemailsmailemailtrash