Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 02-16-2004, 04:32 PM   #1
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, 08:39 PM   #2
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, 08:41 PM   #3
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, 08:45 AM   #4
Registered: Sep 2003
Posts: 76

Original Poster
Rep: Reputation: 15
Thanks green_dragon37.


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

All times are GMT -5. The time now is 05:24 PM.

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