dup: added option --force to cleanup and remove-older-than commands, else they actual...
[matthijs/upstream/backupninja.git] / handlers / rdiff.in
index aa02a5541944cf4f9c2f3c6f6f585590fe227451..0f934299edd0ebc86fea6dfa286079bad4906f91 100644 (file)
@@ -77,6 +77,7 @@ getconf options
 getconf testconnect yes
 getconf nicelevel 0
 getconf bwlimit
+getconf ignore_version no
 
 setsection source
 getconf type; sourcetype=$type
@@ -100,6 +101,10 @@ getconf host; desthost=$host
 getconf sshoptions
 check_consistency "destination" "$type" "$user" "$host"
 
+if [ -n "$sshoptions" ] && echo $options | grep -qv "remote-schema"; then
+       options="$options --remote-schema 'ssh -C $sshoptions %s rdiff-backup --server'"
+fi
+
 ### CHECK CONFIG ###
 
 # If vservers are configured, check that the ones listed in $vsnames do exist.
@@ -127,7 +132,7 @@ if [ "$testconnect" = "yes" ] || [ "${test}" -eq 1 ]; then
        test_connection $destuser $desthost
 fi
 
-if [ $ignore_version != "yes" ]; then
+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`
@@ -137,7 +142,6 @@ if [ $ignore_version != "yes" ]; then
 fi
 
 # source specific checks
-[ "$include" != "" -o "$vsinclude" != "" ] || fatal "No source includes specified"
 case $sourcetype in 
        remote ) execstr_sourcepart="$sourceuser@$sourcehost::/" ;;
        local  ) execstr_sourcepart="/" ;;
@@ -233,7 +237,7 @@ fi
 set +o noglob
 
 # exclude everything else
-execstr="${execstr}--exclude '/*' "
+[ "$include" != "" -o "$vsinclude" != "" ] && execstr="${execstr}--exclude '/*' "
                
 # include client-part and server-part
 execstr="${execstr}$execstr_sourcepart $execstr_destpart"