catch protocol mismatch (multiple --link-dest)
This commit is contained in:
parent
c4bcbc290f
commit
12f2908c9d
6
debian/changelog
vendored
6
debian/changelog
vendored
@ -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
|
||||
|
||||
* fix rotation
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user