crond
Giuseppe Greco
giuseppe.greco at agamura.com
Wed Jan 5 06:18:33 UTC 2005
On Tue, 2005-01-04 at 20:09 -0600, Jeff Vian wrote:
> On Tue, 2005-01-04 at 20:04 -0500, Erik Hemdal wrote:
> > >
> > > I've written the following script (named checkconn)
> > > to be executed every 5 minutes by crond:
> > >
> > >
> >
> > . . .
> >
> > > `/sbin/adsl-stop`
> > > `/sbin/adsl-start`
> >
> > . . .
> >
> > > 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.
> > >
> >
> > Here are a few thoughts. Anything in /sbin is likely to need root privilege
> > to run.
> > So make sure that you use root's crontab, or place the entries in
> > /etc/crontab and specify
> > that they run as user root. Also, since cron uses a limited path, make
> > certain that
> > /root/cron is in the path (add a PATH= line to the crontab entry). Try man
> > 8 crontab (IIRC) for information
> > on the crontab file format as opposed to the crontab command.
> >
>
> 1. For Erik:
> His command uses the full path. Thus the path comment above is
> superfluous.
>
> 2. for j3d.
> The script being called by cron should contain a shebang line as the
> first line. Does it?
> it should look like "#! /bin/sh". You can look at any of the scripts
> in /etc/init.d to see what should be there.
>
> 3. For j3d:
> What is the purpose of stop/start the adsl connection every 5
> minutes? As I understand it you are simply verifying the connection is
> intact. It would make more sense to do a simple ping to some host on
> the internet, and if that fails then do the stop/start. Otherwise the
> connection is good and you quit.
> A drawback to your approach is that the IP address may (and often
> does) change when the adsl connection is re-established. If you are
> using it the IP change may kick you off, and with a long download that
> can be a problem.
Often the pppoe connection stops working even if pppd is still running,
and then I'm not able to access the Internet anymore. When that happens,
the only thing I can do is to restart the ppp0 interface...
I'm trying to figure out the source of the problem, but till now no
way...
j3d.
>
>
>
--
----------------------------------------
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