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

RE: CRON - Can you make CRON run faster than every minute



What I need to do is to check the second channel of an ISDN link to ensure
that it is always up.
I have a script running in CRON every minute.  This came as part of the
utilities with the ISDN card.  One minute is not so much of a problem.  I
was just curious.

sydney:/usr/local/bin# less chkisdn.sh
#!/bin/sh
#file: /usr/local/bin/chkisdn.sh

UPCOUNT=`imontty  |  awk  '/Out/{print $2}'  |  wc  -l`
if [ ! $UPCOUNT = 2 ]; then
    isdnctrl addlink ippp0
    /bin/date >> /etc/ppp/addlink.log
fi

We have 2 different cases.

On the server here, the primary channel comes up by itself but wont bring
the secondary up, so we have to run the script in CRON.

On the server in our branch offices, the primary channel does not come up
automatically (there is no secondary), and the only difference is that the
cards are slightly different, although they are from the same manufacturer.
I have had to modify and compile my own version of pppupd to handle this.
This should probably be a separate topic.

Ian





> -----Original Message-----
> From: Mike Fedyk [mailto:mikef@matchmail.com]On Behalf Of Mike Fedyk
> Sent: Friday, July 20, 2001 2:27 PM
> To: 'Debian Users'
> Subject: Re: CRON - Can you make CRON run faster than every minute
>
>
> > Thus spake Ian Perry (iperry@inertia.com.au):
> >
> > > Hi Debianers,
> > >
> > > I need to make CRON run faster than every minute. Every
> 15 seconds would be
> > > good. Is this possible ?
>
> On Thu, Jul 19, 2001 at 10:20:48PM -0600, Robert L. Harris wrote:
> > Don't think you can speed it up, but you can have a script
> run once a
> > min, sleep 15, run, sleep 15, run, etc.
> >
> > If you ahve to:
> >
> > cron1   * * * * * command
> > cron2   * * * * * sleep 15; command
> > cron3   * * * * * sleep 30; command
> > cron4   * * * * * sleep 45; command
> >
> > which is real ugly, but will work
>
> Yep it is ugly, and you use more resources that way too.
>
> Ian, what exactly are you trying to do?
>
> Whenever I've had a need for something like this, I wrote a little
> script that runs in daemon (server or constantly running) mode.
>
> Do you need to process files in a certain directory, but only when
> there are files?  Why do you need to run so often?
>
> Mike
>
>
> --
> To UNSUBSCRIBE, email to debian-user-request@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact
> listmaster@lists.debian.org




Reply to: