rdiff-backup on Windows

rdiff-backup is a very handy utility to effectively create and manage incremental file backups. Most modern GNU/Linux distributions offer rdiff-backup as installable package. Sadly there is no easy to install version available for Windows.
So, here is a short guide:
If you have Cygwin installed, you’re almost ready to go. Make sure to install the following packages with the Cygwin installer:

Devel/
autoconf
automake
binutils
gcc
make
patchutils
Interpreters/
python
Web/
wget

Next step is to open the Cygwin console. We have to download librsync because it is a prerequisite for rdiff-backup. To do so, type the following:

# wget http://mesh.dl.sourceforge.net/sourceforge/librsync/librsync-0.9.7.tar.gz

Now we need to unpack the archive and build it:

# tar xzf librsync-0.9.7.tar.gz
# cd librsync-0.9.7
# ./configure --prefix=/usr --bindir=/bin --libdir=/lib
# make all
# make install

Next step is to download rdiff-backup:

# cd ..
# wget http://savannah.nongnu.org/download/rdiff-backup/rdiff-backup-1.1.5.tar.gz

Now unpack the archive:

# tar xzf rdiff-backup-1.1.5.tar.gz
# cd rdiff-backup-1.1.5

I had a problem with version 1.1.0-1.1.5 where rdiff-backup would stop with a stack trace and an uncaught exception while finishing the backup. In this process it’s calling fsync, which is unsupported on Windows. Thus, we need to apply a quick and dirty patch to the file rpath.py before continuing.

# cd rdiff_backup
# wget http://www.katastrophos.net/downloads/rpath-fsync.patch
# patch < rpath-fsync.patch
# cd ..

Type this to install rdiff-backup:

# python setup.py install

If the installation was successful, you can safely delete the directories and files downloaded:

# cd ..
# rm rdiff-backup-1.1.5.tar.gz librsync-0.9.7.tar.gz
# rm -Rf rdiff-backup-1.1.5 librsync-0.9.7

More information on how to use rdiff-backup can be found here.

Update 1 (January 24th, 2006): Updated to version 1.1.5.

m4s0n501

23 Responses to “rdiff-backup on Windows”

  • davekempe Says:

    I have an installer for rdiff-backup on windows here:
    http://solutionsfirst.com.au/~dave/backup/
    it does not include this patch, but I hope to update the package to 1.0.5 and include your patch with a warning in the readme. I suppose ideally, fsync by python cygwin would be supported in a win32 fashion, but its not going to happen. Anyway, check out my package if you want an easy way to get it up and running.

    thanks

    dave

  • Duplicity at Katastrophos.net Blog Says:

    [...] As a follow up to my previous article on rdiff-backup, I’ve patched duplicity to work correctly on Cygwin. To install it you’ll need the same prerequisites as for rdiff-backup. 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: [...]

  • Andre Says:

    Hey Dave!
    Thanks for the hint. I’ll check it out.
    As for the fsync patch. It’s really just a dirty workaround and could probably be handled in a more elegant fashion.

    Regards,
    Andre

  • Dmitry Vereschaka Says:

    Dave,
    Thank you for your windows version of rdiff-backup!
    But there are several problems:
    1. .bat files are hardcoded to use c:\rdiff-backup folder. When installing into other folder, they are not working.
    2. you should save your filelists used in –exclude-filelist –exclude-globbing-filelist and so on in unix format (LF), not windows format (CRLF), otherwise rdiff-backup will not find any file or directory since they aren’t ended with CR.

    Do you plan to support windwows version of this tool? current version is 1.04, yours – 1.01.

  • duplicity 0.4.2 on Cygwin at Katastrophos.net Blog Says:

    [...] 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: [...]

  • Ben Says:

    I followed the top-most post, nice work. Any idea why I would get the following:

    Tue Apr 18 23:11:36 2006 Fatal Error: Time of Last backup is not in the past.
    This is probably caused by running two backups in less than a second. Wait a second a try again.

    This happens if I re-run rdiff-backup after the initial run.

    $ date
    Tue Apr 18 23:20:34 EDT 2006
    $ /usr/bin/rdiff-backup c:/temp/test c:/temp/test2

    $ /usr/bin/rdiff-backup c:/temp/test c:/temp/test2
    Fatal Error: Time of Last backup is not in the past. This is probably caused
    by running two backups in less than a second. Wait a second a try again.

    $ date
    Tue Apr 18 23:21:06 EDT 2006

    $ /usr/bin/rdiff-backup c:/temp/test c:/temp/test2
    Fatal Error: Time of Last backup is not in the past. This is probably caused
    by running two backups in less than a second. Wait a second a try again.

  • Ryan Says:

    The step “./configure –prefix=/usr –bindir=/bin –libdir=/lib” dies with “bash: ./configure: /bin/sh: bad interpreter: No such file or directory”.

    Mind boggling that cygwin does not ship with a working /bin/sh/. Worse still, I can’t find sh.exe ANYWHERE in the packages listed in setup.exe — not under “Shells,” not under “Devel,” not under “Base”, “Interpreters” — it’s not anywhere.

    This is infuriating. Cygwin – aghhhh!

  • Ryan Says:

    Reinstalling ash, coreutils and some other randomly selected things seems to have fixed sh.exe issue.

  • Ryan Says:

    Note: Unix files with illegal windows chars — the asterisk in my case (“*”) — will choke rdiff-backup and derail your whole backup.

  • The Highlights » Windows and Mac backups using rdiff-backup Says:

    [...] A patch needed get rdiff-backup working on Windows (that I got from here http://katastrophos.net/andre/blog/?p=19) [...]

  • Ideensammlung. » Blog Archive » Rdiff-backup 1.1.5 mit Windows XP und cygwin nutzen Says:

    [...] Zum Schluss möchte ich noch 17od.com und katastrophes.net danken, da ich eigentlich nur kopiert hab… [...]

  • Morgan Says:

    Hi
    Does the patch work for 1.1.10? Or, is it specific to 1.1.5?
    Thanks

  • chencho Says:

    Hi all!

    I want to update with 1.1.5 rdiff-backup your app, but i have some problems.

    I have not idea how to make rdiff-backup “standalone”, without cygwin installation; i made your installation, then setup cygwin and compile rdiff-backup and finally replace all of the files that appers twice in your install and in cygwin. In this way i have a problem with cygwin1.dll :(

    Can you show as how to make rdiff-backup standalone without cygwin??

    Thanks.

  • Todd Says:

    PERFECT! FYI – in version 1.0.5 of rdiff-backup line 1075 of rpath.py has the line which needs to be commented out…

    $ diff rpath.py rpath.py.orig
    1075c1075
    os.fsync(fd)

    Thanks for posting this info.

  • Carl Stephenson Says:

    Thanks for writing this tutorial! I don’t think that I could have gotten rdiff-backup on Windows working without your help!!

  • Andrew Ferguson Says:

    This patch is no longer necessary starting with version 1.1.8 of rdiff-backup.

    Also, version 1.1.12 incorporates a number of improvements for those running on Cygwin. It now compiles and runs ‘out of the box’.

  • Sriram M Says:

    Thanks Dave. I sucessfully installed the rdiffbackup 1.0.1 from http://solutionsfirst.com.au/~dave/backup/ folder and it works gr8.

    However I need a favour. Do you have any installer (for windows) for the version 1.0.5?

    Any help is appreciated.

  • Mico Says:

    I tried to build rdiff-backup under Windows XP using MinGW. Compilation process seemed OK but when I try to use rdiff-backup, for example: python rdiff-backup then appear error message: no module named grp, pwd. I thought because in user_group.py there is a line stating import grp, pwd. I tried rdiff-backup version 1.1.16 (newest).

  • Luís Miranda Says:

    This is now available in the Cygwin installer.

  • Ernie Says:

    Looking for Step-by-Step guide for windows install, is there any out there for the beginners?

    Thanks,

    Newbie!!

  • chencho Says:

    You have a windows version into rdiff-backup home page:

    http://www.gnu.org/savannah-checkouts/non-gnu/rdiff-backup/

  • Pipps Says:

    Thank you for this excellent guide! It is still helping new Rdiff users today!

    I followed all of the commands in the article, and it all installed perfectly for me.

    I have just one very simply and probably silly unanswered question:

    How do I run Rdiff now?

  • Home Oxygen Says:

    Thank you for this excellent guide! It is still helping new Rdiff users today!

Leave a Reply

*