catch protocol mismatch (multiple --link-dest)

This commit is contained in:
Vincent Riquer 2012-02-08 10:50:29 +01:00
parent c4bcbc290f
commit 12f2908c9d
2 changed files with 28 additions and 7 deletions

6
debian/changelog vendored
View File

@ -1,3 +1,9 @@
remote-backup (1.3.0) stable; urgency=low
* Catch protocol mismatch, retry with less options (multiple --link-dest requires protocol >= 29)
-- Vincent Riquer <v.riquer@b2f-concept.com> Wed, 08 Feb 2012 10:45:51 +0100
remote-backup (1.2.2) stable; urgency=low remote-backup (1.2.2) stable; urgency=low
* fix rotation * fix rotation

View File

@ -157,6 +157,11 @@ runBackup() {
# identical. # identical.
RSYNC_OPTS="-a --exclude-from=$EXCLUDES --bwlimit=$BWLIMIT" RSYNC_OPTS="-a --exclude-from=$EXCLUDES --bwlimit=$BWLIMIT"
if [[ $2 == PROTOCOLMISMATCH ]]
then
proto29=1
MAX_ROTATE=1
fi
for (( backup_num=0 ; backup_num <= MAX_ROTATE ; backup_num++ )) for (( backup_num=0 ; backup_num <= MAX_ROTATE ; backup_num++ ))
do do
if [ -d "$SNAPSHOT_RW/$NAME/daily.$backup_num" ] if [ -d "$SNAPSHOT_RW/$NAME/daily.$backup_num" ]
@ -182,7 +187,16 @@ runBackup() {
$RSYNC_OPTS \ $RSYNC_OPTS \
"${REMOTE_LOCATION}" \ "${REMOTE_LOCATION}" \
"$SNAPSHOT_RW/$NAME/$1" "$SNAPSHOT_RW/$NAME/$1"
if (( $? == 10 )) \ if (( $? == 2 ))
then
if (( proto29 ))
then
echo "Still failing, giving up"
else
echo "Rsync protocol mismatch, trying with only one --link-dest"
runBackup "$1" PROTOCOLMISMATCH
fi
elif (( $? == 10 )) \
|| (( $? == 12 )) \ || (( $? == 12 )) \
|| (( $? == 20 )) \ || (( $? == 20 )) \
|| (( $? == 21 )) \ || (( $? == 21 )) \
@ -200,6 +214,7 @@ runBackup() {
$TOUCH "$SNAPSHOT_RW/$NAME/$1" $TOUCH "$SNAPSHOT_RW/$NAME/$1"
# and thats it # and thats it
unset proto29
} }
# make sure we're running as root # make sure we're running as root