blob: 5962eef6643145990c2b9c565ed1afebe5430ebf (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
#!/bin/bash
#
# Simple sync script.
#
# Parameters
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 -avz rsync://cache.sarava.org/cache/data/ data/
# Teardown
rm $LOCKFILE
|