duplicity 0.4.2 on Cygwin

Ben Escoto has released version 0.4.2 of duplicity. My previous patch for version 0.4.1 already included most of the changes in 0.4.2.
For the sake of completeness, here is my updated patch bundle which adds Cygwin / Windows support and fixes some problems in the FTP backend:


To install it you’ll need the same prerequisites as for rdiff-backup, most notably librsync. Please refer to these instructions on how to install it.
Additionally you should install the Utils/gnupg package in order to get the encryption working.
Here is how to compile and install duplicity:

First off, you need to grab the current version:

# wget http://savannah.nongnu.org/download/duplicity/duplicity-0.4.2.tar.gz

Now, unpack the archive:

# tar xzf duplicity-0.4.2.tar.gz
# cd duplicity-0.4.2

Next up: downloading and applying my patch bundle:

# wget http://www.katastrophos.net/downloads/duplicity-0.4.2_katastrophos.net.patch
# patch -p1 < duplicity-0.4.2_katastrophos.net.patch

Here is the final step:

# python setup.py install --prefix=/usr/local

Fin. :)

For Cygwin-Users:
I’ve made my build directory available, in case you are running into problems compiling librsync et al.:
Just copy the extracted build directory to your duplicity-0.4.2 source tree and enter

# python setup.py install --prefix=/usr/local

The patch bundle above includes the following patches:
Andre Beckedorf:
– improved Cygwin/Win32 support
– FTP backend’s NLST and QUIT behavior fixed, visible with default OS X FTP server
Stefan Schimanski:
– FTP timeout patch (official Debian patch)

Tested and working on Cygwin and Darwin (OS X 10.4.5 PPC/Intel).

10 thoughts on “duplicity 0.4.2 on Cygwin

  1. Hey there,
    thanks for your good tutorial! Too bad that I receive a “broken pipe” everytime I use duplicity, no way to make it work.

    I execute
    TMPDIR=”/tmp” PASSPHRASE=”XXX” nice -n 19 /usr/bin/duplicity –short-filenames –encrypt-key XXX –sign-key XXX –include /etc/ –exclude ‘**’ / file:///var/backups/

    This is what I get:
    No signatures found, switching to full backup.
    Traceback (most recent call last):
    File “/usr/bin/duplicity”, line 373, in ?
    if __name__ == “__main__”: main()
    File “/usr/bin/duplicity”, line 366, in main
    if not sig_chain: full_backup(col_stats)
    File “/usr/bin/duplicity”, line 142, in full_backup
    bytes_written = write_multivol(“full”, tarblock_iter, globals.backend)
    File “/usr/bin/duplicity”, line 78, in write_multivol
    File “/usr/lib/python2.4/site-packages/duplicity/gpg.py”, line 215, in GPGWrit
    IOError: [Errno 32] Broken pipe
    close failed: [Errno 32] Broken pipe

    Do you have any idea?


  2. I just started trying to work with this tool and am getting the same error. Guess this doesn’t bode well on finding a fix w/out some digging.

  3. Maximus,

    I’m using the same key for signing encrypting and if I’m using “plain GPG” it works perfectly.

  4. Found this via google. Just for others:

    Broken pipe occurs – at least with me – when using a key wit dsa over 1024 (e.g. 2048 default running ubuntu/debian).

    Create a new key using lower strength!

  5. Duplicity 0.4.12 is now available and has many bug fixes.
    wget http://savannah.nongnu.org/download/duplicity/duplicity-0.4.12.tar.gz

    I don’t believe the patches are required now, but haven’t done extensive tests yet.

    In cygwin install, need to select following packages in addition to defaults:
    wget (to simplify installing the non-cygwin packages)

    I couldn’t find python-dev anymore, but it didn’t seem to matter.

    I had to download the following packages separately as they are not bundled as a cygwin package:
    GnuPGInterface 0.3.2 or later (http://py-gnupg.sourceforge.net)
    Boto 0.9d or later (http://code.google.com/p/boto) — if you wish to use the Amazon S3 service)
    pexpect 2.1 or later (http://pexpect.sourceforge.net) — if you plan to use the ssh backend

    For some reason I’m getting the “mkpasswd (272): [1359] An internal error occurred.” message from my cygwin install and can’t find a good fix yet, but everything seems to work ok so far.

  6. I am having the same problem with duplicity 4.12 and using just 1024 bit. Is lower than 1024 necessary? Thanks

  7. Hi, thanks for the tutorial! Managed to get it to work – except had to move/copy the duplicity module from cygwin\usr\local\lib\python2.5\site-packages to cygwinpt\lib\python2.5\site-packages

    Then, I needed to understand there are two different sets of keys – one for ssh/scp (which should work passwordless before tryig duplicity), and another – gpg – for encrypting the archives. I also encountered the gpg problem, solved it by installing gnupg, running
    $ gpg –gen-key
    here noting the comment ‘gpg: key ABABABAB marked as ultimately trusted’
    and then running
    $ gpg –list-keys
    you will see:
    .. ————————————–
    .. pub 1024D/ABABABAB 2008-10-12
    .. uid XX

    and then use this ABABABAB key as in

    $ duplicity -–encrypt-key ABABABAB -–sign-key ABABABAB “/cygdrive/c/TEMP” scp://user@server.net/bckp

    Now, this is all OK – but I have a problem – this does create an archive on the server, but if I execute the exact same command several times in a row without changing files, it always uploads archives with sizes the same as initial one !! Shouldn’t it detect no changes, and transfer 0 bytes?: “If the above is run repeatedly, the first will be a full backup, and subsequent ones will be incremental.” http://duplicity.nongnu.org/duplicity.1.html. Same thing happens for specifying –no-encryption instead of encryption and signing keys. (I n00bishly suspect this may have to do something with the Cygwin filesystem…)

    Any pointers for this would be great!

    Update2: tried http://launchpadlibrarian.net/7933525/duplicity_0.4.2-10.1ubuntu1.1.dsc.diff manually, ran setup.py again, but there seems to be no fix – it still cannot detect increments, not even when trying without encryption, and running:

    $ duplicity –verify –no-encryption -v 9 scp://user@server.net/bckp /cygdrive/c/temp/

  8. / Author, can you please integrate below with previous post? /

    Update: the above seems to be a known bug:

    duplicity – Bugs: bug #19998, Incremental Backups Do Not Work On…

    “This is caused by a ValueError exception in duplicity’s tarfile.py, because it uses int() on strings containing (NUL) characters.
    This exception does not happen with Python 2.4, and also is not specific to Ubuntu’s Python 2.5.”

    Don’t have Python 2.4 now, so cannot tell..

Leave a Reply

Your email address will not be published. Required fields are marked *


This site uses Akismet to reduce spam. Learn how your comment data is processed.