retry transfer
This commit is contained in:
parent
ea72b4d2dd
commit
c128c5c7a4
@ -74,6 +74,8 @@ done
|
|||||||
|
|
||||||
declare -a failedBackups
|
declare -a failedBackups
|
||||||
declare -A failedWith
|
declare -A failedWith
|
||||||
|
RETRY=5
|
||||||
|
RETRY_DELAY=60
|
||||||
|
|
||||||
failRsync() {
|
failRsync() {
|
||||||
nameFailed="$1"
|
nameFailed="$1"
|
||||||
@ -208,6 +210,8 @@ runBackup() {
|
|||||||
RSYNC_OPTS="$RSYNC_OPTS --timeout=1800"
|
RSYNC_OPTS="$RSYNC_OPTS --timeout=1800"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
for (( try=1 ; try <= RETRY ; try++ ))
|
||||||
|
do
|
||||||
$RSYNC \
|
$RSYNC \
|
||||||
$RSYNC_OPTS \
|
$RSYNC_OPTS \
|
||||||
$ADDITIONAL_RSYNC_OPTS \
|
$ADDITIONAL_RSYNC_OPTS \
|
||||||
@ -215,6 +219,25 @@ runBackup() {
|
|||||||
"$SNAPSHOT_RW/$NAME/$1"
|
"$SNAPSHOT_RW/$NAME/$1"
|
||||||
|
|
||||||
returncode=$?
|
returncode=$?
|
||||||
|
case $returncode in
|
||||||
|
0)
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
2)
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
cat <<-EOF
|
||||||
|
|
||||||
|
Trial $try / $RETRY failed.
|
||||||
|
Sleeping $RETRY_DELAY...
|
||||||
|
|
||||||
|
EOF
|
||||||
|
sleep $RETRY_DELAY
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
case $returncode in
|
case $returncode in
|
||||||
0)
|
0)
|
||||||
:
|
:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user