Hi Dave,
I use the following and it works a treat!

put this extra line in crontab to run a file every 5 minutes.
*/5 * * * * root run-parts /etc/cron.5minutes

then create a directory called /etc/cron.5miutes
put a file in there called ppp

in the file ppp have the following...
#!/bin/bash
cd /etc/ppp
ps ax|fgrep pppd|fgrep -v fgrep > /dev/null || /usr/sbin/pppd
exit 0

set the permissions on the file to execute.

then every 5 minutes the cron job will check if a ppp process is running. if so
then nothing will happen. if not then it will dial up.
a word of warning. if you dial the wrong number, you'll be paying for a call
every five minutes. check this whole thing manually first!

Ben


Dave Kempe wrote:

> Hey sluggers,
> I'm very newbie at writing scripts or any sort of programming really.
> Wondering where I would start to write a script that checked to see if the
> PPP link was up and if it wasn't brought it up? I know that the modem lock
> files would be useful cos nothing else uses the modem, so the existance of
> /var/lock/LCK..ttyS0 is reasonable. Or is there a better way in /proc
> something.
>
> The other question i have is how to understand the entries in crontab.
> I have read a few cron tutuorials, and still don't exactly understand how to
> make cron do something once an hour or once a day.
> I don't exactly understand what each column means in the 6 or so *'s that
> are at the start of the crontab entry. Anyone care to share the secret?
>
> thanks,
>
> Dave
>
> --
> SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
> More Info: http://slug.org.au/lists/listinfo/slug



--
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://slug.org.au/lists/listinfo/slug

Reply via email to