Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 27642 Details for
Bug 45155
run-crons and /var/spool/cron/lastrun/lock problems
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
new run-crons version
run-crons (text/plain), 1.98 KB, created by
Mathias Gumz
on 2004-03-19 12:36:38 UTC
(
hide
)
Description:
new run-crons version
Filename:
MIME Type:
Creator:
Mathias Gumz
Created:
2004-03-19 12:36:38 UTC
Size:
1.98 KB
patch
obsolete
>#!/bin/sh ># ># $Header: /home/cvsroot/gentoo-x86/sys-apps/cronbase/files/run-crons,v 1.9 2003/11/19 06:31:23 prez Exp $ ># ># 23 Jun 2002; Jon Nelson <jnelson@gentoo.org> run-crons: ># ># fixed a race condition, where cron jobs and run-crons wanted to delete ># touch files ># ># 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 > >LOCKDIR=/var/spool/cron/lastrun >LOCKFILE=${LOCKDIR}/lock > >mkdir -p ${LOCKDIR} > ># Make sure its not running multiple instances at once. >if cronpid=`cat ${LOCKFILE} 2>/dev/null` >then > if `kill -0 $cronpid >/dev/null 2>&1` > then > exit 0 > fi >fi > >echo "$$" > ${LOCKFILE} > >for BASE in hourly daily weekly monthly >do > CRONDIR=/etc/cron.${BASE} > > test -d $CRONDIR || continue > > if [ -e ${LOCKDIR}/cron.$BASE ] > then > case $BASE in > hourly) > #>= 1 hour, 5 min -=> +65 min > TIME="-cmin +65" ;; > daily) > #>= 1 day, 5 min -=> +1445 min > TIME="-cmin +1445" ;; > weekly) > #>= 1 week, 5 min -=> +10085 min > TIME="-cmin +10085" ;; > monthly) > #>= 31 days, 5 min -=> +44645 min > TIME="-cmin +44645" ;; > esac > find ${LOCKDIR} -name cron.$BASE $TIME -exec rm {} \; > fi > > # if there is no touch file, make one then run the scripts > if [ ! -f ${LOCKDIR}/cron.$BASE ] > then > touch ${LOCKDIR}/cron.$BASE > > set +e > for SCRIPT in $CRONDIR/* > do > [ -d $SCRIPT ] && continue > if [ -x $SCRIPT ]; then > $SCRIPT > fi > done > fi >done > ># Remove lock, we're done. >rm -f ${LOCKFILE} > >touch ${LOCKDIR} >find ${LOCKDIR} -newer ${LOCKDIR} -exec /bin/rm -f {} \; >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 45155
:
27641
|
27642
|
30876
|
30877