Output of Cron Clogging up my inbox.

Alexander Dalloz alexander.dalloz at uni-bielefeld.de
Wed Apr 21 17:16:06 UTC 2004


Am Mi, den 21.04.2004 schrieb Ow Mun Heng um 09:55:

> Hi Guys,
> 
> 	I have a cron job made for running mrtg on my adsl connection 
> at an interval of 1 minute apart. However, my ADSL conn is
> not 24/7 turned on. So.. during the times when my PC is on, and the ASDL
> isn't, cron still continues to run and since it can't find the ppp0
> connection, it'll output the error at a rate of 1 email per minute and I end up 
> with a clogged inbox.
> 
> cron 
> 0-59/1 * * * * root /usr/bin/mrtg /etc/mrtg/mrtg.cfg
> 
> I know I should add a /dev/null somewhere, I tried
> 
> 0-59/1 * * * * root /usr/bin/mrtg /etc/mrtg/mrtg.cfg > /dev/null
> 
> 0-59/1 * * * * root /usr/bin/mrtg /etc/mrtg/mrtg.cfg 2 >&1 > /dev/null
> 
> Both does not work.
> 
> Cheers

Either write a little script that checks whether you have a DSL
connection or not and in the case you haven't it will not run the mtrg
command.
Or just use not the /etc/crontab but run "crontab -e -u root" and fill
that root user's crontab starting with MAILTO="" and then the proper
mrtg command line:

*/1 * * * * /usr/bin/mrtg /etc/mrtg/mrtg.cfg

See man 5 crontab for details.

Solution 1 would be smarter I feel.

Alexander


-- 
Alexander Dalloz | Enger, Germany | GPG key 1024D/ED695653 1999-07-13
Fedora GNU/Linux Core 1 (Yarrow) on Athlon CPU kernel 2.4.22-1.2179.nptl
Sirendipity 19:09:39 up 3 days, 1:55, load average: 0.06, 0.33, 0.31 
                   [ Γνωθι σ'αυτον - gnothi seauton ]
             my life is a planetarium - and you are the stars
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Dies ist ein digital signierter Nachrichtenteil
URL: <http://listman.redhat.com/archives/fedora-list/attachments/20040421/ab5f261f/attachment-0001.sig>


More information about the fedora-list mailing list