To receive notifications about scheduled maintenance, please subscribe to the mailing-list You can subscribe to the mailing-list at

Commit a5f78f67 authored by Reto Da Forno's avatar Reto Da Forno
Browse files

simple locking mechanism added to update script

parent 0ce2e723
......@@ -38,6 +38,7 @@
HOST="whymper" # default server
RSYNCPARAMS="-a -z -c -K --exclude=.* --no-perms --no-owner --no-group --ignore-times --delete"
LOCKFILE="update.lock" # write '1' into this file (on the server) to prevent this script from updating/overwriting files
if [ $# -gt 0 ]; then
......@@ -46,6 +47,13 @@ fi
echo "Going to update files on FlockLab server $HOST..."
sleep 2 # give the user time to abort, just in case
# simple locking mechanism: before continuing, make sure the lock is released
RES=$(ssh ${USER}@${HOST} "cat ${LOCKFILE}" 2> /dev/null)
if [ $? -eq 0 ] && [ $RES == "1" ]; then
echo "File system is locked."
exit 1;
# testmanagement server files
# optional to only look for changed files: | grep '^<fc' | cut -d' ' -f2
RES=$(rsync ${RSYNCPARAMS} -i --dry-run -e 'ssh -q' testmanagementserver/ ${USER}@${HOST}:testmanagementserver 2>&1)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment