From 8fe6f59b8b6aa18aac6865d657425ee38799432f Mon Sep 17 00:00:00 2001 From: micah Date: Fri, 2 Nov 2007 00:12:04 +0000 Subject: [PATCH] added ignore_version option to rdiff handler to enable you override the version check git-svn-id: http://code.autistici.org/svn/backupninja/trunk@484 758a04ac-41e6-0310-8a23-8373a73cc35d --- ChangeLog | 5 +++-- examples/example.rdiff | 10 ++++++++++ handlers/rdiff.in | 16 +++++++++------- 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index d227b0d..ba68c07 100644 --- a/ChangeLog +++ b/ChangeLog @@ -28,10 +28,11 @@ version 0.9.5 -- unreleased . Support configuring PGSQLUSER for real, and document it a bit; this broken support actually prevented pgsql handler to work for VServers (Closes: #396578) - rdiff: + rdiff-backup: . Added cstream support to allow for bandwidth limiting . Handle "keep = yes" to disable old backups removal (Closes: #424633) - . Ignore rdiff-backup minor versions (thanks Sami Haahtinen) + . Add configuration option to allow you to disable the version check + as in some instances this may be an ok scenario (Closes: #424632) rub . Fixed typo in rub handler that caused it to not work . Changed to use lib/vserver code diff --git a/examples/example.rdiff b/examples/example.rdiff index c327fd6..3767f9b 100644 --- a/examples/example.rdiff +++ b/examples/example.rdiff @@ -20,6 +20,16 @@ ## -t option for more information. 62500 bytes = 500 Kb (.5 Mb) # bwlimit = 62500 +## should backupninja ignore the version differences between source and remote +## rdiff-backup? (default: no) +## This could be useful if the version differences between rdiff-backup instances +## on remote and local side are different, and you are certain there are no +## problems in using mis-matched versions and want to get beyond this check. +## An example usage could be the remote side has its authorized_keys configured +## with command="rdiff-backup --server" to allow for restricted yet automated +## password-less backups +# ignore_version = no + ###################################################### ## source section ## (where the files to be backed up are coming from) diff --git a/handlers/rdiff.in b/handlers/rdiff.in index 46cae49..aa02a55 100644 --- a/handlers/rdiff.in +++ b/handlers/rdiff.in @@ -32,12 +32,12 @@ function get_version() { # if user or host is missing, returns the local version. if [ "$#" -lt 2 ]; then debug "$RDIFFBACKUP -V" - echo `$RDIFFBACKUP -V | cut -d. -f1,2` + echo `$RDIFFBACKUP -V` else local user=$1 local host=$2 debug "ssh $sshoptions $host -l $user '$RDIFFBACKUP -V'" - echo `ssh $sshoptions $host -l $user "$RDIFFBACKUP -V | grep rdiff-backup | cut -d. -f1,2"` + echo `ssh $sshoptions $host -l $user "$RDIFFBACKUP -V | grep rdiff-backup"` fi } @@ -127,11 +127,13 @@ if [ "$testconnect" = "yes" ] || [ "${test}" -eq 1 ]; then test_connection $destuser $desthost fi -# see that rdiff-backup has the same version at the source and destination -sourceversion=`get_version $sourceuser $sourcehost` -destversion=`get_version $destuser $desthost` -if [ "$sourceversion" != "$destversion" ]; then - fatal "rdiff-backup does not have the same version at the source and at the destination." +if [ $ignore_version != "yes" ]; then + # see that rdiff-backup has the same version at the source and destination + sourceversion=`get_version $sourceuser $sourcehost` + destversion=`get_version $destuser $desthost` + if [ "$sourceversion" != "$destversion" ]; then + fatal "rdiff-backup does not have the same version at the source and at the destination." + fi fi # source specific checks -- 2.30.2