crond

Giuseppe Greco giuseppe.greco at agamura.com
Wed Jan 5 06:09:08 UTC 2005


On Tue, 2005-01-04 at 21:24 -0600, Thomas Cameron wrote:
> 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?

Yes.
j3d.

> 
> Thomas
> 
-- 
----------------------------------------
Giuseppe Greco

::agamura::

phone:  +41 (0)91 604 67 65
mobile: +41 (0)79 602 99 27
email:  giuseppe.greco at agamura.com
web:    www.agamura.com
----------------------------------------




More information about the fedora-list mailing list