]> git.armaanb.net Git - bin.git/blobdiff - git-mirror
signal-finder: add script
[bin.git] / git-mirror
index ebde74b774e62de9abde66c4d7f6b7c3fa04c667..6d3f00cad6a7e6810d7b72deefd9834796909630 100755 (executable)
@@ -4,6 +4,7 @@
 usage() {
   echo 'Usage: git-mirror [command] [arguments]
   git-mirror run [path to repos] [path to log file] [html directory]
+      optional: [sleep duration]
   git-mirror gen-url [path to repo] -- generate url file in repo
   git-mirror help -- show this message
 
@@ -19,9 +20,10 @@ run() {
   cd ${1}
 
   [ -d ${3} ] || mkdir ${3}
-  cd ${3} && stagit-index ${1}/*
+  cd ${3}
 
   while :; do
+    stagit-index ${1}/*
     find "$1" -name '*.git' -type d | \
       while read dir; do
         newdir=${3}/$(basename ${dir} .git)
@@ -39,7 +41,7 @@ run() {
           echo $(date -Iseconds) ' | ' ${dir} | tee -a ${2}
           echo $(tail -n 1500 ${2}) > ${2}
         done
-        sleep 600
+        sleep ${4:-600}
       done
     }