9, February 2010

Disable email alerts in crontab - webmaster forum

 
Webdigity webmaster forums
[ Home | Help | Search | Forum's Shop | Archive | Login | Register | Webmaster Directory ]
Webdigity Webmaster Forums  >  Web hosting talk  >  Configuring your server
Topic: Disable email alerts in crontab
« previous next »
Pages: [1] Print

Author Topic: Disable email alerts in crontab  (Read 4422 times)
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 5642
45485 credits
Members referred : 3



« on: Dec 23, 2006, 02:56:08 pm »

Today I checked my mail server and realized that there are thousands of bounced emails that were statistics regarding the crontab.

Crontab regularly will send one email for each crontab entry which will contain all the output from the command that executed.

But as most of those are useless, and in case that you don't recieve this email adress, it can cause some problems to the mail server, so here is a simple solution to get over it. First open your crontab entries by typing this command in console :

Code:
crontab -e

Then edit each and every record - that you don't want to recieve email - and append this :  > /dev/null 2>&1

For instance this line :

Code:
00 6 * * * root rdate -s time.nist.gov

will become :

Code:
00 6 * * * root rdate -s time.nist.gov > /dev/null 2>&1

Enjoy Wink

Trial and Error my two best teachers Cool
Join us @ facebook or twitter

Last blog : Butterfly Marketing 2.0
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 5642
45485 credits
Members referred : 3



« Reply #1 on: Dec 27, 2006, 03:37:49 pm »

Somebody asked at Digg :

Quote
What if we want to send the email to some other email id? say, instead of the default admin ID, i want to send the cron output to soem other secondary email id ! What to do in that case?

The answer is this, but I am not sure if it actually works as I haven't tested :

Code:
00 6 * * * root rdate -s time.nist.gov | mail -s "Subject of mail" user@host.tld

Replace user@host.tld with the email address that you want to receive the mail and you are done Smiley

Trial and Error my two best teachers Cool
Join us @ facebook or twitter

Last blog : Butterfly Marketing 2.0
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=5369
Tags : linux crontab admin mail Bookmark this thread : Digg Del.icio.us Dzone more....

Pages: [1] Print 
Webdigity Webmaster Forums  >  Web hosting talk  >  Configuring your server
Topic: Disable email alerts in crontab
« previous next »
Jump to:
User Area
Welcome, Guest. Please login or register.
Did you miss your activation email?
Feb 09, 2010, 10:21:07 pm





Login with username, password and session length

Donate to our community, and get a permanent link back to your site!

Donate to our community, and get a permanent link back to your site!





Readers

Web Design Gallery · Whois Lookup · Pagerank · Tag Browsing · Lo-fi version · Syndication · Webmaster forum history · Advertise
Developed by HumanWorks © 2005 - 2010 Webdigity webmaster community · sublime directory
Webdigity Webmaster Forums | Powered by SMF 1.0.12. © 2001-2005, Lewis Media. All Rights Reserved.