diff --git a/debian/changelog b/debian/changelog index 6e0fc21..c8766aa 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 Wed, 08 Feb 2012 10:45:51 +0100 + remote-backup (1.2.2) stable; urgency=low * fix rotation diff --git a/remote-backup b/remote-backup index 8b7cb87..2f33077 100755 --- a/remote-backup +++ b/remote-backup @@ -157,6 +157,11 @@ runBackup() { # identical. 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++ )) do if [ -d "$SNAPSHOT_RW/$NAME/daily.$backup_num" ] @@ -182,13 +187,22 @@ runBackup() { $RSYNC_OPTS \ "${REMOTE_LOCATION}" \ "$SNAPSHOT_RW/$NAME/$1" - if (( $? == 10 )) \ - || (( $? == 12 )) \ - || (( $? == 20 )) \ - || (( $? == 21 )) \ - || (( $? == 22 )) \ - || (( $? == 23 )) \ - || (( $? == 30 )) + 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 )) \ + || (( $? == 20 )) \ + || (( $? == 21 )) \ + || (( $? == 22 )) \ + || (( $? == 23 )) \ + || (( $? == 30 )) then if [ -d "$SNAPSHOT_RW/$NAME/$1" ] then @@ -200,6 +214,7 @@ runBackup() { $TOUCH "$SNAPSHOT_RW/$NAME/$1" # and thats it + unset proto29 } # make sure we're running as root