From 73e2aa4cee08900882d77cb94a74c338aa9740f2 Mon Sep 17 00:00:00 2001 From: Hsieh Chin Fan Date: Wed, 12 Apr 2023 11:49:55 +0800 Subject: Update --- bin/unix/rsync_retry.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 bin/unix/rsync_retry.sh (limited to 'bin/unix') 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 @@ +#! /bin/sh + +REMOTE=${REMOTE:-vps} +SRC="$1" +DEST="$2" +DEST="${DEST:-$1}" + +# If fail to sync file, then +if rsync -au "${SRC}" ${REMOTE}:"${DEST}"; then + rm "${SRC}".retry 2>/dev/null + true +else + echo ${DEST} >${SRC}.retry +fi -- cgit v1.2.3-70-g09d2