how to avoid receiving an email every time a cron task is executed

How can you disable the automatic sending of mails to the sysadmin in linux/unix each time a task is run in the crontab list?

I found the solution thanks to a very useful explanation between adding:

>/dev/null

or

>/dev/null &2>1

to a cron task.

Both of them avoid that an email is sent everytime a task is completed. But in the second case it will also avoid sending error mails.

Read the details here http://www.mydigitallife.info/cron-differences-between-devnull-21-and-devnull/

The mails are sent if you don’t use either of those two at the end of the cron task. I didn’t know it and was receiving tons of alerts, since I have a cron every two minutes!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s