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
|
remote-backup (1.2.2) stable; urgency=low
|
||||||
|
|
||||||
* fix rotation
|
* fix rotation
|
||||||
|
|||||||
@ -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,13 +187,22 @@ runBackup() {
|
|||||||
$RSYNC_OPTS \
|
$RSYNC_OPTS \
|
||||||
"${REMOTE_LOCATION}" \
|
"${REMOTE_LOCATION}" \
|
||||||
"$SNAPSHOT_RW/$NAME/$1"
|
"$SNAPSHOT_RW/$NAME/$1"
|
||||||
if (( $? == 10 )) \
|
if (( $? == 2 ))
|
||||||
|| (( $? == 12 )) \
|
then
|
||||||
|| (( $? == 20 )) \
|
if (( proto29 ))
|
||||||
|| (( $? == 21 )) \
|
then
|
||||||
|| (( $? == 22 )) \
|
echo "Still failing, giving up"
|
||||||
|| (( $? == 23 )) \
|
else
|
||||||
|| (( $? == 30 ))
|
echo "Rsync protocol mismatch, trying with only one --link-dest"
|
||||||
|
runBackup "$1" PROTOCOLMISMATCH
|
||||||
|
fi
|
||||||
|
elif (( $? == 10 )) \
|
||||||
|
|| (( $? == 12 )) \
|
||||||
|
|| (( $? == 20 )) \
|
||||||
|
|| (( $? == 21 )) \
|
||||||
|
|| (( $? == 22 )) \
|
||||||
|
|| (( $? == 23 )) \
|
||||||
|
|| (( $? == 30 ))
|
||||||
then
|
then
|
||||||
if [ -d "$SNAPSHOT_RW/$NAME/$1" ]
|
if [ -d "$SNAPSHOT_RW/$NAME/$1" ]
|
||||||
then
|
then
|
||||||
@ -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
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user