Server Fault is a question and answer site for system and network administrators. 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

I have the following line in my /etc/cron.d/apache2watch file

* * * * * root /bin/ &> /dev/null

I am currently receiving hundreds of mails to root because of this. I don't know why root is still receiving mail every second or so telling me that the cron job was run - even though I have clearly redirected outputs to /dev/null

Can anyone explain why root continues to receive mail, and how I can change this behaviour?

I am running on Ubuntu 10.04 LTS

share|improve this question

You are still receiving emails probably because you have only redirected standard output to /dev/null. Your shell script probably writes to stderr too, so correct redirection would be like:

* * * * * root /bin/ > /dev/null 2>&1
share|improve this answer

Insert MAILTO="" before you crontab line.

share|improve this answer

why don't you set MAILTO="" in particular user's here 'root' crontab. This will disable logging of mail messages in /var/spool/mail/

share|improve this answer
Some cronjobs were saved in /var/spool/mail/, I would never found this without you, thank you! – Luca Steeb Jul 14 '15 at 12:44

You have redirected outputs to /dev/null, but only if you're using bash as your crontab shell. I believe that by default you'd be using /bin/sh.

To fix it, I'd recommend thor's solution:

* * * * * root /bin/ > /dev/null 2>&1

The other solution is to change CRON to use bash by putting this at the beginning of your crontab entry:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.