Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

The web is full of suggestions how to disable mailing in cron like asked here stop linux from emailing me cron errors?. Is there really no global config flag I can set to disable mailing in cron for all users and all commands. I really don't want to tell all users you have to add

MAILTO=""

or

<command> > /dev/null 2>&1

to your crontab.

share|improve this question
1  
this is very common way to do, you can also disable sendmail|postfix. –  alexus Mar 14 at 15:09

1 Answer 1

according to the man page can disable cron mail by adding -m off to the daemon args

   -m     This option allows you to specify a shell command to use for sending Cron mail  output  instead  of
          using  sendmail(8)  This command must accept a fully formatted mail message (with headers) on stan‐
          dard input and send it as a mail message to the recipients specified in the mail headers.  Specify‐
          ing the string off (i.e., crond -m off) will disable the sending of mail.
share|improve this answer
    
Nice one. On Ubuntu where can i define the daemon args? –  Laoneo Mar 14 at 15:09
    
I'm no ubuntu/upstart expert. I guess you'd have to change in /etc/init/cron.conf or add in /etc/init/cron.override, see init manpage –  Gryphius Mar 14 at 15:32
1  
Ubuntu uses vixiecron by default which does not have this option, unfortunately I am also unsure about what is the actual solution for this in ubuntu, anyone? –  Onitlikesonic Mar 17 at 12:24
    
@Onitlikesonic As far as I'm aware there's no way to globally disable cron emails in Vixie cron - you may be out of luck unless you're willing to change your cron daemon (which is probably the easiest solution)... –  voretaq7 Mar 18 at 16:46

Your Answer

 
discard

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.