crontab

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

The content of this field is kept private and will not be shown publicly.
  • You can use Markdown syntax to format and style the text.
  • Lines and paragraphs break automatically.
  • Allowed HTML tags: <a> <cite> <code> <strong> <em> <blockquote> <b> <i> <p> <br> <ul> <ol> <li>

More information about formatting options