summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThilo Bangert <bangert@gentoo.org>2002-04-20 17:48:33 +0000
committerThilo Bangert <bangert@gentoo.org>2002-04-20 17:48:33 +0000
commit75f64bb746c557fc698d844632dc86d6c6e5a6c7 (patch)
tree6ca46b00255010a4fad55c49b17553e917e74387 /sys-apps/cronbase/files
parentrelay-ctrl - POP3 or IMAP before SMTP package for qmail (diff)
downloadgentoo-2-75f64bb746c557fc698d844632dc86d6c6e5a6c7.tar.gz
gentoo-2-75f64bb746c557fc698d844632dc86d6c6e5a6c7.tar.bz2
gentoo-2-75f64bb746c557fc698d844632dc86d6c6e5a6c7.zip
the new cronbase package - future releases of the different crons will depend on this
Diffstat (limited to 'sys-apps/cronbase/files')
-rw-r--r--sys-apps/cronbase/files/digest-cronbase-0.010
-rw-r--r--sys-apps/cronbase/files/run-crons56
2 files changed, 56 insertions, 0 deletions
diff --git a/sys-apps/cronbase/files/digest-cronbase-0.01 b/sys-apps/cronbase/files/digest-cronbase-0.01
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/sys-apps/cronbase/files/digest-cronbase-0.01
diff --git a/sys-apps/cronbase/files/run-crons b/sys-apps/cronbase/files/run-crons
new file mode 100644
index 000000000000..e62797aa8133
--- /dev/null
+++ b/sys-apps/cronbase/files/run-crons
@@ -0,0 +1,56 @@
+#!/bin/sh
+#
+#
+# 20 Apr 2002; Thilo Bangert <bangert@gentoo.org> run-crons:
+#
+# moved lastrun directory to /var/spool/cron/lastrun
+#
+#
+# Author: Achim Gottinger <achim@gentoo.org>
+#
+# 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 CRONDIR in /etc/cron.{hourly,daily,weekly,monthly}
+do
+
+ test -d $CRONDIR || continue
+ BASE=${CRONDIR##*/}
+ test -e /var/spool/cron/lastrun/$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) TIME="-ctime +30 -or -ctime 30" ;;
+ esac
+ eval find /var/spool/cron/lastrun/$BASE $TIME | \
+ xargs --no-run-if-empty rm
+ }
+ if test ! -e /var/spool/cron/lastrun/$BASE ; then
+ touch /var/spool/cron/lastrun/$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 | \
+ xargs --no-run-if-empty rm
+