duplicity-talk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Duplicity-talk] Duplicity only witch scp and sftp...


From: Jiri Tyr
Subject: [Duplicity-talk] Duplicity only witch scp and sftp...
Date: Wed, 05 Oct 2005 16:19:19 +0200
User-agent: Mozilla Thunderbird 1.0.7 (X11/20051003)

Hello,

I'm using duplity still long time and it didn't woked right with rssh (http://rssh.sourceforge.net/). For right working is enough to change /usr/lib/python2.3/site-packages/duplicity/backends.py. In the enclosure is the patch.

Best Regards,
Jiri Tyr


*** ./old/backends.py   2005-10-05 16:14:10.000000000 +0200
--- ./my/backends.py    2005-10-05 16:13:39.000000000 +0200
***************
*** 257,262 ****
--- 257,263 ----
  # shell, so shouldn't have strange characters in them.
  ssh_command = "ssh"
  scp_command = "scp"
+ sftp_command = "sftp"
  
  class scpBackend(Backend):
        """This backend copies files using scp.  List not supported"""
***************
*** 293,311 ****
                be distinguished from the file boundaries.
  
                """
!               commandline = ("%s %s ls %s" %
!                                          (ssh_command, self.host_string, 
self.remote_dir))
                return filter(lambda x: x, self.popen(commandline).split("\n"))
  
        def delete(self, filename_list):
                """Runs ssh rm to delete files.  Files must not require 
quoting"""
                assert len(filename_list) > 0
                pathlist = map(lambda fn: self.remote_prefix + fn, 
filename_list)
!               del_prefix = "%s %s rm " % (ssh_command, self.host_string)
  
                # Delete in groups of 10 to avoid overflowing command line
                for i in range(0, len(pathlist), 10):
!                       commandline = del_prefix + " ".join(pathlist[i:i+10])
                        self.run_command(commandline)
  
  
--- 294,313 ----
                be distinguished from the file boundaries.
  
                """
!               commandline = ("echo -e 'cd %s\nls -1' | %s -b - %s | grep -v 
'sftp> '" %
!                                          (self.remote_dir, sftp_command, 
self.host_string))
                return filter(lambda x: x, self.popen(commandline).split("\n"))
  
        def delete(self, filename_list):
                """Runs ssh rm to delete files.  Files must not require 
quoting"""
                assert len(filename_list) > 0
                pathlist = map(lambda fn: self.remote_prefix + fn, 
filename_list)
!               del_prefix = "echo 'rm "
!               del_postfix = "' | %s -b - %s 1>/dev/null" % (sftp_command, 
self.host_string)
  
                # Delete in groups of 10 to avoid overflowing command line
                for i in range(0, len(pathlist), 10):
!                       commandline = del_prefix + " ".join(pathlist[i:i+10]) + 
del_postfix
                        self.run_command(commandline)
  
  

reply via email to

[Prev in Thread] Current Thread [Next in Thread]