/[baselayout]/trunk/sbin/run-crons
Gentoo

Contents of /trunk/sbin/run-crons

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4 - (show annotations) (download)
Mon Aug 13 02:07:46 2001 UTC (17 years, 9 months ago) by drobbins
File size: 1086 byte(s)
new version (1.1) of rc-scripts package

1 #!/bin/sh
2 #
3 #
4 # Author: Achim Gottinger <achim@gentoo.org>
5 #
6 # Mostly copied from SuSE
7 #
8 # this script looks into /etc/cron.[hourly|daily|weekly|monthly]
9 # for scripts to be executed. The info about last run is stored in
10 # /var/cron/lastrun
11
12 mkdir -p /var/cron/lastrun
13
14 #
15
16 for CRONDIR in /etc/cron.{hourly,daily,weekly,monthly}
17 do
18
19 test -d $CRONDIR || continue
20 BASE=${CRONDIR##*/}
21 test -e /var/cron/lastrun/$BASE && {
22
23 case $BASE in
24 cron.hourly) TIME="-cmin +60 -or -cmin 60" ;;
25 cron.daily) TIME="-ctime +1 -or -ctime 1" ;;
26 cron.weekly) TIME="-ctime +7 -or -ctime 7" ;;
27 cron.monthly) TIME="-ctime +30 -or -ctime 30" ;;
28 esac
29 eval find /var/cron/lastrun/$BASE $TIME | \
30 xargs --no-run-if-empty rm
31 }
32 if test ! -e /var/cron/lastrun/$BASE ; then
33 touch /var/cron/lastrun/$BASE
34
35 set +e
36 for SCRIPT in $CRONDIR/*
37 do
38 test -d $SCRIPT && continue
39 if test -x $SCRIPT ; then
40 $SCRIPT
41 fi
42 done
43 fi
44 done
45
46 #
47
48 touch /var/cron/lastrun
49 find /var/cron/lastrun -newer /var/cron/lastrun | \
50 xargs --no-run-if-empty rm

Properties

Name Value
svn:eol-style native
svn:executable *
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.20