Package: backupninja
Followup-For: Bug #346040

Hi.

I did some work to get there. I have attached a patch that adds a
"protocol" option, that, if unset defaults to scp.

It's not quite clean yet, because it lacks documentation and it's
really just a flag right now. Not sure what would happen if you'd
enter, say, "ssh" or (!) "ftp" as a protocol. :) Maybe backupninja
should check for this...

I also haven't tested what happens if you *don't* enter a protocol (or
put "scp"). I guess it will behave fine, but I don't have a remote
setup to do formal testing.


-- System Information:
Debian Release: 4.0
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18-3-686
Locale: LANG=fr_CA.UTF-8, LC_CTYPE=fr_CA.UTF-8 (charmap=UTF-8)
--- dup.orig    2006-04-08 22:12:35.000000000 +0000
+++ dup 2007-01-10 17:23:27.000000000 +0000
@@ -7,6 +7,7 @@
 getconf options
 getconf testconnect yes
 getconf nicelevel 0
+getconf protocol scp
 
 setsection gpg
 getconf password
@@ -69,10 +70,16 @@
 
 ### COMMAND-LINE MANGLING ###
 
-scpoptions="$sshoptions"
-[ "$bandwidthlimit" == 0 ] || scpoptions="$scpoptions -l $bandwidthlimit"
+if [ "$protocol" != "file" ]; then
+     scpoptions="$sshoptions"
+     [ "$bandwidthlimit" == 0 ] || scpoptions="$scpoptions -l $bandwidthlimit"
+fi
+
+execstr="$options --no-print-statistics "
 
-execstr="$options --no-print-statistics --scp-command 'scp $scpoptions' 
--ssh-command 'ssh $sshoptions' "
+if [ "$protocol" != "file" ]; then
+     execstr="${execstr}--scp-command 'scp $scpoptions' --ssh-command 'ssh 
$sshoptions' "
+fi
 
 # deal with symmetric or asymmetric (public/private key pair) encryption
 if [ -n "$encryptkey" ]; then
@@ -108,7 +115,11 @@
     execstr="${execstr}--full "
 fi
 
-execstr_serverpart="scp://[EMAIL PROTECTED]/$destdir"
+if [ "$protocol" == "file" ]; then
+    execstr_serverpart="$protocol:///$destdir"
+else
+    execstr_serverpart="$protocol://[EMAIL PROTECTED]/$destdir"
+fi
 execstr_clientpart="/"
 
 ### SOURCE ###

Reply via email to