crontab
Submitted by Robert Daeley on Sat, 2006-04-01 01:16.
I was looking around for a way to customize if and where mail is sent from the results of cron jobs and learned (via man cron) of a MAILTO variable that can be used in your crontab. Put this as the first line of your crontab:
MAILTO = "example@foo.com"
and all cron job results will be mailed there. If you’d rather suppress the mailing of results altogether, use this:
MAILTO = ""
Another option is to redirect individual entries into nothingness, such as this:
* 3 * * * /usr/bin/perl /path/to/foobar.pl >> /dev/null 2>&1
That last bit, 2>&1 means to send errors to the same place as regular messages, i.e. the void.
Post new comment