summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThilo Bangert <bangert@gentoo.org>2002-06-26 09:48:04 +0000
committerThilo Bangert <bangert@gentoo.org>2002-06-26 09:48:04 +0000
commit55e56190f0cc8e0602b415b51b697cace3143318 (patch)
treec983e15a0798ea2d7b86a03f59fa47a3d24bd14b /sys-apps/cronbase
parentnew snapshot (diff)
downloadhistorical-55e56190f0cc8e0602b415b51b697cace3143318.tar.gz
historical-55e56190f0cc8e0602b415b51b697cace3143318.tar.bz2
historical-55e56190f0cc8e0602b415b51b697cace3143318.zip
this reintroduces the deletion of cron touchfiles in run-crons, while fixing the original race
Diffstat (limited to 'sys-apps/cronbase')
-rw-r--r--sys-apps/cronbase/ChangeLog10
-rw-r--r--sys-apps/cronbase/files/run-crons21
2 files changed, 29 insertions, 2 deletions
diff --git a/sys-apps/cronbase/ChangeLog b/sys-apps/cronbase/ChangeLog
index a898f5da1cea..8e9473f36e00 100644
--- a/sys-apps/cronbase/ChangeLog
+++ b/sys-apps/cronbase/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for sys-apps/cronbase
# Copyright 2002 Gentoo Technologies, Inc.; Distributed under the GPL
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/cronbase/ChangeLog,v 1.4 2002/06/23 17:37:19 bangert Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/cronbase/ChangeLog,v 1.5 2002/06/26 09:48:04 bangert Exp $
+
+ 23 Jun 2002; Thilo Bangert <bangert@gentoo.org> files/run-crons :
+
+ rethought rewrite and fixed a race. thanks go to jnelseon and george
+
+
+*cronbase-0.2 (24 Jun 2002)
23 Jun 2002; Thilo Bangert <bangert@gentoo.org> files/run-crons :
@@ -10,6 +17,7 @@
moved lastrun to /var/spool/cron/lastrun
+
*cronbase-0.01 (19 Apr 2002)
19 Apr 2002; Thilo Bangert <bangert@gentoo.org> ChangeLog :
diff --git a/sys-apps/cronbase/files/run-crons b/sys-apps/cronbase/files/run-crons
index 7c4351ec56fe..614959443ce3 100644
--- a/sys-apps/cronbase/files/run-crons
+++ b/sys-apps/cronbase/files/run-crons
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/cronbase/files/run-crons,v 1.5 2002/06/23 17:37:19 bangert Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/cronbase/files/run-crons,v 1.6 2002/06/26 09:48:04 bangert Exp $
#
# 23 Jun 2002; Jon Nelson <jnelson@gentoo.org> run-crons:
#
@@ -29,6 +29,25 @@ do
test -d $CRONDIR || continue
+ if test -e /var/spool/cron/lastrun/cron.$BASE
+ then
+ case $BASE in
+ hourly)
+ #>= 65 min -=> +64 min
+ TIME="-cmin +64" ;;
+ daily)
+ #>= 1 day, 5 min -=> +1444 min
+ TIME="-cmin +1444" ;;
+ weekly)
+ #>= 1 week, 5 min -=> +10084 min
+ TIME="-cmin +10085" ;;
+ monthly)
+ #>= 30 days, 5 min -=> +43204 min
+ TIME="-cmin +43204" ;;
+ esac
+ find /var/spool/cron/lastrun/cron.$BASE $TIME -exec rm {} \;
+ fi
+
# if there is no touch file, make one then run the scripts
if test ! -f /var/spool/cron/lastrun/cron.$BASE
then