aboutsummaryrefslogtreecommitdiffhomepage
path: root/bin/unix/rsync_retry.sh
diff options
context:
space:
mode:
Diffstat (limited to 'bin/unix/rsync_retry.sh')
-rwxr-xr-xbin/unix/rsync_retry.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/bin/unix/rsync_retry.sh b/bin/unix/rsync_retry.sh
new file mode 100755
index 0000000..be70c03
--- /dev/null
+++ b/bin/unix/rsync_retry.sh
@@ -0,0 +1,14 @@
1#! /bin/sh
2
3REMOTE=${REMOTE:-vps}
4SRC="$1"
5DEST="$2"
6DEST="${DEST:-$1}"
7
8# If fail to sync file, then
9if rsync -au "${SRC}" ${REMOTE}:"${DEST}"; then
10 rm "${SRC}".retry 2>/dev/null
11 true
12else
13 echo ${DEST} >${SRC}.retry
14fi