From: Joerg Jaspert Date: Fri, 18 Dec 2015 21:25:32 +0000 (+0100) Subject: cron.hourly locks itself X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=95215adf6d9317e11be1118fb6144396c6dddf04;p=dak.git cron.hourly locks itself --- diff --git a/config/debian/cron.hourly b/config/debian/cron.hourly index 3c58395c..d2451b8a 100755 --- a/config/debian/cron.hourly +++ b/config/debian/cron.hourly @@ -2,6 +2,10 @@ # # Executed hourly via cron, out of dak's crontab. +# Only one of me should ever run. +[ "${FLOCKER}" != "$0" ] && exec env FLOCKER="$0" flock -E 0 -en "$0" "$0" +"$@" || : + set -e set -o pipefail set -u