From: Quentin Smith Date: Mon, 7 Sep 2009 07:42:30 +0000 (-0400) Subject: Fetch script for hudson without logging X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=5ad6ee93ea58cc9bb2f88c14678ea53b9c8d9094;p=sipb-mirrors.git Fetch script for hudson without logging --- diff --git a/fetch-hudson b/fetch-hudson new file mode 100644 index 0000000..907f72e --- /dev/null +++ b/fetch-hudson @@ -0,0 +1,32 @@ +#!/bin/bash + +set -e + +. ./OPTIONS.sh + +scriptname=$1 +shift + +if [ -z "$scriptname" ]; then + echo "Run with a fetch script as an argument:" + (cd fetch-scripts && ls) + exit 1 +fi + +if ! [ -e fetch-scripts/"$scriptname" ]; then + echo "Unknown fetch script $scriptname" + exit 1 +fi + +date +"Starting $scriptname: %c" + +#NB: -r is number of retries, at 8 second intervals +if lockfile -r 900 "$MIRRORDIR/.locks/$scriptname"; then + date +"Received lock: %c" + (. fetch-scripts/"$scriptname") + exitstatus=$? + rm -f "$MIRRORDIR/.locks/$scriptname" +fi + +date +"Done: %c" +exit $exitstatus