#!/bin/sh # # $Header: /home/cvsroot/gentoo-x86/sys-apps/cronbase/files/run-crons,v 1.3 2002/05/13 18:34:05 bangert Exp $ # # 20 Apr 2002; Thilo Bangert run-crons: # # moved lastrun directory to /var/spool/cron/lastrun # # # Author: Achim Gottinger # # Mostly copied from SuSE # # this script looks into /etc/cron.[hourly|daily|weekly|monthly] # for scripts to be executed. The info about last run is stored in # /var/spool/cron/lastrun mkdir -p /var/spool/cron/lastrun # for BASE in hourly daily weekly monthly do CRONDIR=/etc/cron.${BASE} test -d $CRONDIR || continue # if there is no touch file, make one then run the scripts if test ! -f /var/spool/cron/lastrun/cron.$BASE then touch /var/spool/cron/lastrun/cron.$BASE set +e for SCRIPT in $CRONDIR/* do test -d $SCRIPT && continue if test -x $SCRIPT ; then $SCRIPT fi done fi done # touch /var/spool/cron/lastrun find /var/spool/cron/lastrun -newer /var/spool/cron/lastrun -exec /bin/rm -f {} \;