LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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, 04: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, 04:51 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
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, 04: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, 05:08 AM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
@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



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 02:53 AM
qmail not sending emails lsimon4180 Linux - Software 1 10-18-2004 11:35 PM
Planned sending of emails Denisvt Programming 1 05-08-2004 08:34 AM
help with sending html emails pdelucia Linux - General 1 09-13-2003 11:06 AM
Cron has stopped sending emails shanagg Linux - General 0 07-02-2003 01:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:30 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
Open Source Consulting | Domain Registration