added ignore_version option to rdiff handler to enable you override the version check
authorMicah Anderson <micah@riseup.net>
Fri, 2 Nov 2007 00:12:04 +0000 (00:12 +0000)
committerMicah Anderson <micah@riseup.net>
Fri, 2 Nov 2007 00:12:04 +0000 (00:12 +0000)
ChangeLog
examples/example.rdiff
handlers/rdiff.in

index d227b0d47a6ca3ae1446eb97d51d91389fabb45e..ba68c07e20ce486ce30fbfd456927a475b4b07d1 100644 (file)
--- 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
index c327fd61564b43095b58d77920355e396de35865..3767f9b6c9e7d0b26119e9f5ff8d7aa500dc272a 100644 (file)
 ## -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)
index 46cae4981d0277e980d2b6671e32481e2aba4d67..aa02a5541944cf4f9c2f3c6f6f585590fe227451 100644 (file)
@@ -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