{ 11 comments… read them below or add one }

1 Renish Ladani 08.02.07 at 1:57 pm

I tried above thing and it works on my server
Thanks.
-Renish

2 Henrik Johansen 08.03.07 at 8:36 am

Setting MAILTO="" in your crontab disables the sending of emails aswell.

3 Anand Sharma 08.30.07 at 7:52 am

If your crontab has huge number of scripts to run it would be cumbersome to append >/dev/numm 2>&1 to each line. Like I have 369 scripts in my crontab. So I find it better to have the MAILTO=”" line at the start of my crontab instead.

4 Gopal 01.25.08 at 9:26 am

But if you have so many cron jobs and you want disable mail alert for a few of them, while other jobs needs a mail alert, then &>/dev/null would be the best choice.

Thanks

5 Prolific Programmer 02.01.08 at 2:09 pm

For the csh scripts, at least on every system I have access to, to redirect stderr, you need to put >& /dev/null after the command, not &> as indicated by the note.

6 Matt Balloon 03.07.08 at 3:23 pm

I used your tip for my openads installation, thanks, I think cronjobs are pretty complicated things

7 Phil 10.12.08 at 12:10 pm

If you want the crontab to run daily, weekley, monthly etc.. a good shortcut is to use the variables

@daily, @weekley etc…

It saves you accidently missing out a * and getting thousands of emails by mistake

http://unixhelp.ed.ac.uk/CGI/man-cgi?crontab+5

for a full list of them

8 Sebastián Perrone 12.10.08 at 5:32 pm

I try MAILTO environment var and work ok. Thanks for help !

9 slowpoison 06.22.09 at 8:58 pm

Is it MAILTO or EMAILTO?
Only MAILTO worked for me. I think EMAILTO is wrong.

10 Vivek Gite 06.22.09 at 9:38 pm

@ slowpoison

Thanks for the heads-up.

11 edward baddouh 08.10.09 at 1:27 pm

It’ll be better if you redirect only the std output to /dev/null instead redirecting both (stdout & stderr). This way only commands with failure exit status will be delivered.


* * * * /path/to/script.sh > /dev/null

regards,

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Previous FAQ:

Next FAQ:

nixCraft FAQ PDF Collection Now Available To All