duplicity-talk
[Top][All Lists]
Advanced

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

Re: [Duplicity-talk] First full backup has no errors, but --verify does


From: Kenneth Loafman
Subject: Re: [Duplicity-talk] First full backup has no errors, but --verify does
Date: Wed, 19 Dec 2007 10:26:38 -0600
User-agent: Thunderbird 1.5.0.14pre (X11/20071023)

Kenneth Loafman wrote:
> Paul Walker wrote:
>> On Tue, Dec 18, 2007 at 05:44:54PM -0600, Kenneth Loafman wrote:
>>
>>> ncftpls and pure-ftp.  If you run
>>>    'ncftpls ftp://address@hidden/store/backup/home-jacob'
>>> you will see an empty list and duplicity can't work with that.
>> If it helps at all, "ncftpls -l" should work. You get a full listing,
>> though, rather than just the filenames.
> 
> I'm working on a patch to allow Jacob to use pure-ftpd until this
> problem is resolved.  It won't work on all systems, but it should work
> on most.  The only one it won't work on is the one I found that returns
> the name first, then the metadata, a Windows-based server if I recall.

Jacob -- I've attached a patch that works for pure-ftpd and proftpd.  I
have not tested on any other systems and would not hazard a guess as to
what it will do.  It will NOT work with --short-filenames, so Windows
based FTP servers will not work.

All Others -- Use at your own risk.

To patch:
1) go to the site-packages directory where duplicity lives:
   $ cd /usr/lib/python2.x/site-packages/duplicity
2) do the patch as root:
   $ sudo patch < /your/path/duplicity-pure-ftpd.patch
3) there should not be any error messages!

Then try duplicity verify again.  It should work this time.

I'll do something permanent later.

...Ken

Index: duplicity/backends.py
===================================================================
RCS file: /sources/duplicity/duplicity/duplicity/backends.py,v
retrieving revision 1.72
diff -u -r1.72 backends.py
--- duplicity/backends.py       15 Dec 2007 12:58:51 -0000      1.72
+++ duplicity/backends.py       19 Dec 2007 16:07:07 -0000
@@ -587,14 +587,11 @@
                commandline = "ncftpls %s -l '%s'" % \
                                          (self.flags, self.url_string)
                l = self.popen_persist(commandline).split('\n')
-               l = filter(lambda x: x, l)
-               if not l:
-                       return l
-               # if long list is not empty, get short list of names only
-               commandline = "ncftpls %s -1 '%s'" % \
-                                         (self.flags, self.url_string)
-               l = self.popen_persist(commandline).split('\n')
-               return filter(lambda x: x, l)
+               # WARNING: This patch is only for pure-ftpd servers.
+               #          May or may not work on other FTP servers.
+               l = [x.split()[-1] for x in l if x]
+               l = [x for x in l if x.startswith("duplicity")]
+               return l
 
        def delete(self, filename_list):
                """Delete files in filename_list"""

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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