aboutsummaryrefslogtreecommitdiffhomepage
path: root/bin/unix/rsync_retry.sh
blob: be70c0388f324331d98c1b67dfabb94325bdba86 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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