retry transfer

This commit is contained in:
Vincent Riquer 2012-02-09 17:17:58 +01:00
parent ea72b4d2dd
commit c128c5c7a4

View File

@ -74,6 +74,8 @@ done
declare -a failedBackups
declare -A failedWith
RETRY=5
RETRY_DELAY=60
failRsync() {
nameFailed="$1"
@ -208,6 +210,8 @@ runBackup() {
RSYNC_OPTS="$RSYNC_OPTS --timeout=1800"
fi
for (( try=1 ; try <= RETRY ; try++ ))
do
$RSYNC \
$RSYNC_OPTS \
$ADDITIONAL_RSYNC_OPTS \
@ -215,6 +219,25 @@ runBackup() {
"$SNAPSHOT_RW/$NAME/$1"
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
0)
: