diff options
author | Cache Saravento <cache@sarava.org> | 2015-08-08 11:29:46 -0300 |
---|---|---|
committer | Cache Saravento <cache@sarava.org> | 2015-08-08 11:29:46 -0300 |
commit | 6eb2c7fe4af1fae8aea7d5d6c925372687540e09 (patch) | |
tree | 88a81048b04be4514e8057626076acc878608b33 /bin | |
parent | 95a73b1c98e5f6aa87a2650e7c8f35a47f145483 (diff) | |
download | cache-6eb2c7fe4af1fae8aea7d5d6c925372687540e09.tar.gz cache-6eb2c7fe4af1fae8aea7d5d6c925372687540e09.tar.bz2 |
Sync lockfile
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/sync | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -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 |