aboutsummaryrefslogtreecommitdiff
path: root/bin/sync
diff options
context:
space:
mode:
Diffstat (limited to 'bin/sync')
-rwxr-xr-xbin/sync14
1 files changed, 13 insertions, 1 deletions
diff --git a/bin/sync b/bin/sync
index aaae025..5962eef 100755
--- a/bin/sync
+++ b/bin/sync
@@ -7,7 +7,19 @@
DIRNAME="`dirname $0`"
WORK="$DIRNAME/.."
CWD="`pwd`"
+LOCKFILE="$WORK/.sync-lockfile"
+
+# Set lockfile
+if [ -e "$LOCKFILE" ]; then
+ echo "Locked!"
+ exit 1
+else
+ touch $LOCKFILE || exit 1
+fi
# Sync
cd $DIRNAME
-rsync -av rsync://cache.sarava.org/cache/data/ data/
+rsync -avz rsync://cache.sarava.org/cache/data/ data/
+
+# Teardown
+rm $LOCKFILE