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

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



On Fri, Jul 20, 2001 at 02:55:29PM +1000, Ian Perry wrote:
> 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.
> 

Hmm, What I'd do is create a script that will run an external command
every $1 seconds for one minute, then have crond reference to that
script with the normal command after that

Something like:

count=0
interval="$1"
maxtime=60
total=$(( $maxtime / $interval ))
shift
while [ $count -le $total ]; do
  count=$(( $count + 1 ))
  $@
done


Or something like that.  I've never tried executing $@ before, so if
that's wrong, someone please correct me...

Mike



Reply to: