Mailinglist Archive: opensuse (3666 mails)

< Previous Next >
Re: [SLE] cron.daily
  • From: Ken Schneider <suse-list@xxxxxxxxxxxxx>
  • Date: Sat, 05 Mar 2005 16:28:37 -0500
  • Message-id: <1110058116.29583.25.camel@xxxxxxxxxxxxxxxxx>
On Sat, 2005-03-05 at 12:31, Carlos E. R. wrote:
> The Friday 2005-03-04 at 23:22 -0500, Ken Schneider wrote:
>
> > > -*/15 * * * * root test -x /usr/lib/cron/run-crons && /usr/lib/cron/run-crons >/dev/null 2>&1
> > >
> > > The main script gets run every 15 minutes. Then, it does some math to see
> >
> > NO math is performed, cron runs when instructed.
>
> YES it does:
>
> for CRONDIR in /etc/cron.{hourly,daily,weekly,monthly} ; do
> test -d $CRONDIR || continue
> BASE=${CRONDIR##*/}
> TIME_EXT=${BASE##cron.}
>
> test -e $SPOOL/$BASE && {
> case $BASE in
> cron.hourly) TIME="-cmin +60 -or -cmin 60" ;;
> cron.daily) TIME="-ctime +1 -or -ctime 1" ;;
> cron.weekly) TIME="-ctime +7 -or -ctime 7" ;;
> cron.monthly) NOW=`date +%s`
> LASTMONTH=`date -d "last month" +%s`
> DIFF=`expr '(' $NOW - $LASTMONTH ')' / 86400`

Appears to only be doing math on the monthly file, all others are being
compared to how old/new the file is (time stamp check). For the daily
file it is checking to see if the file is either more than one week old
or more than one week in the future. This is a safety check to make sure
that it still runs in case the PC was booted after the call to delete
the file in the /var/spool/cron/lastrun directory. This still does not
call the cron job to run 15 minutes -after- booting the pc only at the
appointed time in /etc/crontab.

But I will agree there is more to this newer style of cron than the old
style.

--
Ken Schneider
UNIX since 1989, linux since 1994, SuSE since 1998

* Only reply to the list please*

"The day Microsoft makes something that doesn't suck is probably
the day they start making vacuum cleaners." -Ernst Jan Plugge


< Previous Next >