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.



January 27th, 2006 at 12:51
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
January 28th, 2006 at 20:00
[…] 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: […]
January 28th, 2006 at 20:03
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
March 31st, 2006 at 15:23
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.
April 3rd, 2006 at 01:07
[…] 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: […]
April 19th, 2006 at 05:21
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.
July 9th, 2006 at 08:47
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!
July 9th, 2006 at 08:57
Reinstalling ash, coreutils and some other randomly selected things seems to have fixed sh.exe issue.
July 9th, 2006 at 23:51
Note: Unix files with illegal windows chars — the asterisk in my case (“*”) — will choke rdiff-backup and derail your whole backup.
October 30th, 2006 at 18:04
[…] A patch needed get rdiff-backup working on Windows (that I got from here http://katastrophos.net/andre/blog/?p=19) […]
February 25th, 2007 at 13:45
[…] Zum Schluss möchte ich noch 17od.com und katastrophes.net danken, da ich eigentlich nur kopiert hab… […]
May 22nd, 2007 at 14:13
Hi
Does the patch work for 1.1.10? Or, is it specific to 1.1.5?
Thanks
May 24th, 2007 at 16:12
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.
June 2nd, 2007 at 00:19
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.
July 2nd, 2007 at 05:49
Thanks for writing this tutorial! I don’t think that I could have gotten rdiff-backup on Windows working without your help!!
July 29th, 2007 at 18:08
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’.
August 24th, 2007 at 16:15
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.
July 2nd, 2008 at 11:21
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).
July 24th, 2008 at 00:31
This is now available in the Cygwin installer.
April 7th, 2009 at 23:04
Looking for Step-by-Step guide for windows install, is there any out there for the beginners?
Thanks,
Newbie!!
April 8th, 2009 at 13:06
You have a windows version into rdiff-backup home page:
http://www.gnu.org/savannah-checkouts/non-gnu/rdiff-backup/
July 18th, 2009 at 15:10
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?
December 11th, 2010 at 12:48
Thank you for this excellent guide! It is still helping new Rdiff users today!