clean NOTIFY files
authorThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Thu, 13 Oct 2011 15:29:05 +0000 (17:29 +0200)
committerThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Thu, 13 Oct 2011 15:29:05 +0000 (17:29 +0200)
scripts/manage-git-mirror.sh

index d253160..78489ec 100755 (executable)
@@ -36,11 +36,24 @@ function status () {
     ls -l /git-mirror/LOCK
 }
 
+function clean () {
+    totrash=$(ls /git-mirror/*/NOTIFIED 2> /dev/null)
+    if [ -z "$totrash" ] ; then
+       echo "No NOTIFIED file found"
+    else
+       echo "Trashing the following files"
+       ls -l $totrash
+       rm -f $totrash
+       echo Done
+    fi
+}
+
 function main () {
     case $1 in
        start) start;;
        stop) stop;;
        status) status;;
+       clean) clean;;
        *) echo "Usage: $COMMAND start|stop";;
     esac
 }