Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I stop cron from emailing me the results of jobs I schedule?

share|improve this question
up vote 15 down vote accepted

By setting the environment variable "MAILTO" as ""

Somethig like:


01 * * * *  /your/path/to/script/
share|improve this answer

If you want a single job to stop email you simply append >/dev/null 2>&1 to it

For example:

0 * * * * /home/script >/dev/null 2>&1
share|improve this answer
If you are sure that one run will finish before the next starts, it can be worth redirecting the output to a named file rather than to /dev/null: that does give the option of checking what happened to the last run if you suspect a problem. – mas Jul 18 '09 at 19:02

Cron only emails you if there is output, either on stdout or stderr.

If it's script you've written, make it less verbose - remove unnecessary echo or print statements. Redirecting stdout to /dev/null is also a valid solution:

2 * * * * /my/script > /dev/null

If you still get messages after doing that, then the output is on stderr, thus it should be an error, which you should resolve.. If not, you can redirect stderr to /dev/null with..

2 * * * * /my/script > /dev/null 2> /dev/null

..although disregarding error messages is generally a bad idea! (How will you know when the cron job is broken?)

You could redirect a specific command's output from stderr to stdout using 2>&1 - for example:

command_which_prints_messages_to_stderr 2>&1 # redirect stderr to stdout

..then direct stdout to /dev/null in your cron job - that way you silence the loud command, without losing error messages

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .