crond
Thomas Cameron
thomas.cameron at camerontech.com
Wed Jan 5 03:24:12 UTC 2005
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
More information about the fedora-list
mailing list