From: Mark Wooding Date: Thu, 28 Aug 2014 14:54:16 +0000 (+0100) Subject: bin/run-mirrors: Run post scripts after mirror jobs. X-Git-Url: https://git.distorted.org.uk/~mdw/mirror-admin/commitdiff_plain bin/run-mirrors: Run post scripts after mirror jobs. After a mirror JOB, run the scripts in etc/post-JOB.d/ to do any other necessary things. This is useful for jobs like `mirror' which do lots of unrelated things. --- diff --git a/bin/run-mirrors b/bin/run-mirrors index 34a3733..cddea70 100755 --- a/bin/run-mirrors +++ b/bin/run-mirrors @@ -56,5 +56,15 @@ for file in $(run-parts --list etc/mirrors.d); do set +e; (trap - INT; exec "$file"); rc=$?; set -e echo echo "*** Finished $(date +%Y-%m-%dT%H:%M:%S); rc = $rc" + if [ -d etc/post-$base.d ]; then + for i in $(run-parts --list etc/post-$base.d); do + s=${i##*/} + echo + echo "*** Running post-script $s at $(date +%Y-%m-%dT%H:%M:%S)" + set +e; (trap - INT; exec "$i"); rc=$?; set -e + echo + echo "*** Finished post-script $s $(date +%Y-%m-%dT%H:%M:%S); rc = $rc" + done + fi ) >>log/$base.log 2>&1 done