Re: crond

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

 



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@xxxxxxxxxxx
web:    www.agamura.com
----------------------------------------


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

  Powered by Linux