[H-GEN] crontab question

Russell Stuart russell-humbug at stuart.id.au
Sun Dec 12 22:33:06 EST 2004


On Mon, 2004-12-13 at 12:33, Anthony Irwin wrote:
> 0,30 * * * * /root/scripts/checkpppstatus.sh
> 
> Below is the script
> #!/bin/bash
> /sbin/ifconfig|/bin/grep ppp0 || /usr/bin/pon
> 
> The computer is running on a Debian Woody system. Any suggestions would 
> be greatly appreciated.

It looks OK to me, so I would start from square 1.

Q:   Check for email coming from cron.
How: ls -lrt /var/mail/., look at any mail box modified today.
     They will be listed last.

Q:    Is cron running it?
How:  Look at the access time of the script, using:
        ls -al /root/scripts/checkpppstatus.sh
      is it changing every 1/2 hour?  If not CRON is not even
      attempting to run your script, so check the basics - is
      it executable, is there a typo in the crontab entry.

Q:    If you get this far CRON is executing your script, but it
      is not working.  So debug you script as cron runs it.
How:  Insert these lines at line 2.
        exec >"/tmp/${0##*/}.trc" 2>&1
        set -xv
      Wait until CRON it runs, look in /tmp for the resulting
      log file.







More information about the General mailing list