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.

Posted in UncategorizedTagged

23 thoughts on “rdiff-backup on Windows

  1. 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

  2. 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

  3. 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.

  4. 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.

  5. 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!

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

  7. 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.

  8. 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.

  9. 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’.

  10. 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).

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

    Thanks,

    Newbie!!

  12. 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?

Leave a Reply

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


*