Crond

Scott Lanning slanning at buphy.bu.edu
Mon Sep 27 19:31:14 EDT 1999


On Mon, 27 Sep 1999, Brad Noyes wrote:
>I'm using cron to look for updating headlines on a few sites. I have
>cron check for new headlines every 30 min using some perl scripts.
>I'm not dialed to the net all that often, so when cron checks for
>new headlines, and it can't connect. I get a message in my local
>mail box. Is there a way to have cron check for a connection to the
>net before it executes the perl scripts so if a connection is not
>established the perl scripts won't be executed and my mail box will
>be be full of messages from crond?

When you dialin with ppp, there is a lockfile created--
/var/run/ppp0.pid, for example. You could have the perl
script check for the existence of the lock file and not
output anything if there is no lock. Similarly, you could
have the perl script grep the output of system("ifconfig")
to see if there's a ppp link. Or better, just have
the cron command which is executed do one of the above.
Otherwise, you could make your .procmailrc skip the messages
from cron.

-
Subcription/unsubscription/info requests: send e-mail with
"subscribe", "unsubscribe", or "info" on the first line of the
message body to discuss-request at blu.org (Subject line is ignored).



More information about the Discuss mailing list