LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-16-2004, 03:32 PM   #1
eyt
Member
 
Registered: Sep 2003
Posts: 76

Rep: Reputation: 15
cron mailto


Hi all,

Is there a way that the cron only email to me if the cron jobs fail ?
I receive the emails every hour from the crob jobs that runs hourly.

I have this in the crontab file -

MAILTO=my email address

01 * * * * root nice -n 19 run-parts /etc/cron.hourly
 
Old 02-16-2004, 07:39 PM   #2
pedro_nf
Member
 
Registered: Sep 2003
Location: France
Distribution: RedHat
Posts: 58

Rep: Reputation: 15
you'll have to put it in the batch file that is run by cron...
 
Old 02-16-2004, 07:41 PM   #3
green_dragon37
Member
 
Registered: Oct 2002
Location: Lower Alabama
Distribution: Slackware, OpenBSD 3.9
Posts: 344

Rep: Reputation: 31
Add "> /dev/null" to the end of the line. Ex.:

01 * * * * root nice -n 19 run-parts /etc/cron.hourly > dev/null
 
Old 02-17-2004, 07:45 AM   #4
eyt
Member
 
Registered: Sep 2003
Posts: 76

Original Poster
Rep: Reputation: 15
Thanks green_dragon37.
 
  


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
need help with mailto carboncopy Linux - Software 1 11-21-2005 01:37 AM
Cron + MAILTO option mikeshn Linux - Software 1 10-19-2004 06:31 AM
mailto phil81 Linux - Newbie 8 04-08-2004 08:11 AM
phoenix mailto nouse66 Linux - Software 2 02-14-2003 02:59 AM
Has anyone set up cron to "mailto" multiple persons? m_cornelsen Linux - General 1 11-17-2001 07:08 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:38 PM.

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