+
+# is the stamp older than an hour ?
+# in minutes
+GRACE=60
+is_old=$(find $RUNNING_FILE -mmin +$GRACE 2> /dev/null)
+if [ -n "$is_old" ] ; then
+ msg "$RUNNING_FILE is older than $GRACE minutes - removing"
+ rm -f $RUNNING_FILE
+fi
+
+if [ -f $RUNNING_FILE ] ; then
+ msg "Found $RUNNING_FILE - another git-mirror seems to be running. Aborting... "
+ exit 1
+fi
+
+trap failure ERR INT
+