Re: crond

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2005-01-04 at 22:09 +0100, Giuseppe Greco wrote: 
> Hi all,
> 
> I've written the following script (named checkconn)
> to be executed every 5 minutes by crond:
> 
> 
> #! /bin/sh
> 
> ping -c 1 -W 3 www.dyndns.org > /dev/null
> 
> if [ $? -ne 0 ] ; then
>     `/sbin/adsl-stop`
>     `/sbin/adsl-start`
> fi
> 
> ... and here is the result of crontab -l:
> 
> 0,10,20,30,40,50 * * * * /root/cron/checkconn
> 5,15,25,35,45,55 * * * * /root/cron/checkconn
> 
> 
> Well, if I execute checkconn from the command line,
> it works as expected, while when checkconn is invoked
> by crond, it doesn't work...
> 
> Any idea?
> j3d.

The first line of the script looks like there is an error.  It should
be:

#!/bin/sh

and not 

#! /bin/sh

Also, you can make your crontab entry look like this:

*/5 * * * * /root/cron/checkconn

This will run the script every 5 minutes.

Is /root/cron/checkconn executable?

Thomas


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux