Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono-tools.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGonzalo Paniagua Javier <gonzalo.mono@gmail.com>2009-07-14 18:53:51 +0400
committerGonzalo Paniagua Javier <gonzalo.mono@gmail.com>2009-07-14 18:53:51 +0400
commitc9215aa4782ae2f8df885eff0dc82132f022d9b2 (patch)
tree038b6c66c2ab91cd5d8fa1d9167c8c75e983f6d4 /webcompare
parente79c8a6a9c4ea5283e83b5f58662060e4de83c72 (diff)
script to be run by cron
svn path=/trunk/mono-tools/; revision=137866
Diffstat (limited to 'webcompare')
-rw-r--r--webcompare/db/update-webcompare.sh32
1 files changed, 32 insertions, 0 deletions
diff --git a/webcompare/db/update-webcompare.sh b/webcompare/db/update-webcompare.sh
new file mode 100644
index 00000000..52969c46
--- /dev/null
+++ b/webcompare/db/update-webcompare.sh
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+# PATH to the directory that has webcompare-db.exe
+WCDB=YOUNEEDAPATHHERE
+
+
+######################################
+cd "${WCDB}" || exit 1
+
+TOKEN_FILE="../binary/1.0/mscorlib.dll"
+STAMP_FILE="../binary/webdb.stamp"
+LOG_FILE="../binary/webdb.log"
+LOCK_FILE="../binary/webdb.lock"
+
+lockfile -l 120 ${LOCK_FILE}
+if [ $? -ne 0 ] ; then
+ echo "lockfile timed out" >> ${LOG_FILE}
+ exit 1
+fi
+
+if [ ! -f ${STAMP_FILE} -o ${TOKEN_FILE} -nt ${STAMP_FILE} ] ; then
+ touch -r ${TOKEN_FILE} ${STAMP_FILE}
+ date > ${LOG_FILE}
+ nice -20 mono webcompare-db.exe >> ${LOG_FILE} 2>&1
+ date >> ${LOG_FILE}
+else
+ D=$(date)
+ echo "${D}: nothing to update" > ${LOG_FILE}
+fi
+rm -f ${LOCK_FILE}
+exit 0
+