Mailinglist Archive: opensuse (3666 mails)

< Previous Next >
Re: [SLE] cron.daily
  • From: "Carlos E. R." <robin1.listas@xxxxxxxxxx>
  • Date: Sat, 5 Mar 2005 18:31:04 +0100 (CET)
  • Message-id: <Pine.LNX.4.58.0503051827090.9759@xxxxxxxxxxxxxxxx>

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`
TIME="-ctime +$DIFF"
;;
esac
# remove all lock files for scripts that are due to run
eval find $SPOOL/$BASE $TIME | \
xargs --no-run-if-empty rm
}
if test ! -e $SPOOL/$BASE ; then
# accept this dir, if it isn't empty
LIST=`find $CRONDIR ! -type d`
if [ ! -z "$LIST" ] ; then
RUN="${RUN} ${TIME_EXT}"
fi
fi
done


That looks as math for me.

So, as you haven't read correctly what I said, I'll not continue reading
the rest of what you said, because your first asumption is completely
wrong.

--
Cheers,
Carlos Robinson


< Previous Next >