LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-10-2003, 05:47 AM   #1
carmeng
LQ Newbie
 
Registered: Dec 2001
Posts: 17

Rep: Reputation: 0
Prevent Cron from sending emails


How can I stop the emails that cron sends when it executes a task? I prefer not to receive any emails.
 
Old 11-10-2003, 05:51 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387
Change (or create if it does not excist):
MAILTO=<name>
to
MAILTO=
in crontab file. Do not remove the complete line, otherwise mail will be send to owner of the crontab.
 
Old 11-10-2003, 05:53 AM   #3
mcleodnine
Senior Member
 
Registered: May 2001
Location: Left Coast - Canada
Distribution: s l a c k w a r e
Posts: 2,731

Rep: Reputation: 45
Looking at the default crontab in a Slackware box...
Code:
47 * * * * /usr/bin/run-parts /etc/cron.hourly 1> /dev/null
Just add the '1> /dev/null' to any line you don't want email for.
 
Old 11-10-2003, 06:08 AM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387
@mcleodnine:

This will only redirect the output (to standerd output) generated by cron_hourly. If anything is wrong with the script, or the line you created in crontab itself is wrong you will recieve an e-mail.

If you do not want to recieve any (cron) generated mails, use the 'MAILTO=' option.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Sending Emails Dragons_Way Linux - Software 2 03-09-2005 03:53 AM
qmail not sending emails lsimon4180 Linux - Software 1 10-19-2004 12:35 AM
Planned sending of emails Denisvt Programming 1 05-08-2004 09:34 AM
help with sending html emails pdelucia Linux - General 1 09-13-2003 12:06 PM
Cron has stopped sending emails shanagg Linux - General 0 07-02-2003 02:03 PM


All times are GMT -5. The time now is 03:45 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration