9, July 2008

Disable email alerts in crontab - webmaster forum

 
Webdigity webmaster forums
This forum shares its ad revenue with its members!
[ 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 2285 times)
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 7945
40623 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 Visit through proxy

Last blog : MIA - Where Nick and Tim
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 7945
40623 credits
Members referred : 3



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

Somebody asked at Digg Visit through proxy :

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 Visit through proxy

Last blog : MIA - Where Nick and Tim
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....

Topic sponsors:
Get a permanent link here for $1.99!


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?
Jul 09, 2008, 12:50:02 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!


Forum Statistics
Total Posts: 35.590
Total Topics: 7.356
Total Members: 3.661
Tutorials : 56
Resources : 143
Designs : 220
Latest Member: komrad

41 Guests, 4 Users online :

17 users online today:



Readers

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