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
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')
-rw-r--r--sys-apps/cronbase/ChangeLog13
-rw-r--r--sys-apps/cronbase/cronbase-0.01.ebuild33
-rw-r--r--sys-apps/cronbase/files/digest-cronbase-0.010
-rw-r--r--sys-apps/cronbase/files/run-crons56
4 files changed, 102 insertions, 0 deletions
diff --git a/sys-apps/cronbase/ChangeLog b/sys-apps/cronbase/ChangeLog
new file mode 100644
index 000000000000..7b49a241091f
--- /dev/null
+++ b/sys-apps/cronbase/ChangeLog
@@ -0,0 +1,13 @@
+# ChangeLog for sys-apps/cronbase
+# Copyright 2002 Gentoo Technologies, Inc.; Distributed under the GPL
+# /space/gentoo/cvsroot/gentoo-x86/skel.ChangeLog,v 1.2 2002/02/05 00:57:47 gbevin Exp
+
+ 20 Apr 2002; Thilo Bangert <bangert@gentoo.org> files/run-crons :
+
+ moved lastrun to /var/spool/cron/lastrun
+
+*cronbase-0.01 (19 Apr 2002)
+
+ 19 Apr 2002; Thilo Bangert <bangert@gentoo.org> ChangeLog :
+
+ initial release ;-)
diff --git a/sys-apps/cronbase/cronbase-0.01.ebuild b/sys-apps/cronbase/cronbase-0.01.ebuild
new file mode 100644
index 000000000000..13ea6ffe73ed
--- /dev/null
+++ b/sys-apps/cronbase/cronbase-0.01.ebuild
@@ -0,0 +1,33 @@
+# Copyright 1999-2002 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License, v2
+# Author: Thilo Bangert <bangert@gentoo.org>
+# /space/gentoo/cvsroot/gentoo-x86/skel.ebuild,v 1.3 2002/02/04 15:46:51 gbevin Exp
+
+DESCRIPTION="The is the base for all cron ebuilds."
+
+#adds ".keep" files so that dirs aren't auto-cleaned
+keepdir() {
+ dodir $*
+ local x
+ for x in $*
+ do
+ touch ${D}/${x}/.keep
+ done
+}
+
+src_install () {
+
+ dodir /usr/sbin
+ doexe ${FILESDIR}/run-crons
+
+ diropts -m0750; keepdir /etc/cron.hourly
+ diropts -m0750; keepdir /etc/cron.daily
+ diropts -m0750; keepdir /etc/cron.weekly
+ diropts -m0750; keepdir /etc/cron.montly
+
+ diropts -m0770 -o root -g cron; keepdir /var/spool/cron
+ diropts -m0770 -o root -g cron; keepdir /var/spool/cron/crontabs
+
+ diropts -m0750; keepdir /var/spool/cron/lastrun
+
+} \ No newline at end of file
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
+