I decided to put a new backup strategy in place at work. I have my desktop PC running windows and an Ubuntu server. I wanted to back up my day-to-day work under windows to the server. I wanted incremental backup so I have the option to backtrack through file history if necessary.
rsync is a nice utility to copy an set of files from one pc to another and works under windows {via Cygwin) and Linux. It can copy over ssh and hence I can use my ssh keys to avoid having to log into the server or put my password in scripts. However it does not do incremental backups, it just duplicates.
rdiff-backup is a nice backup tool that can do cross-network incremental backups. It uses the rsync protocol so it is very efficient. It is also easy to use, no weird command line switches, just give it the name of the source and target directories. However, support for this on windows is not straightforward and it relies on using a cygwin version of python rather than the standard distribution.
So, a compromise solution, use both. I have set things up so that this is done every night when I go home:
cd c:\Projects rsync -avz --exclude-from="rsync.cnf" -e ssh ./ pcw@rd-pcw2:Projects/ > backup.log blat backup.log -to pcw@itl.co.uk
this copies files from my 'Projects' directory to the server. The "rsync.cnf" file is a set of things to exclude from the copy, e.g.:
# # Doxygen output files # - Doxygen/ # # Anything downloaded # - Download/ - lstfiles/ - ofiles/ - *.bak - *.Bak # # Anything generated by py2exe # - build/ - dist/ # # Anything in a folder called Old # - Old/ # # VC build directorys # Debug/ Release/ debug/ release/ # # Miscellaneous. # - *.obj - *.tmp - *.pyc - setup/*.exe - Output/setup.exe
After running this I use blat to email me what happened so I know it succeeded.
On the server I have crontab set up to run rdiff-backup every night after the files have been uploaded:
0 18 * * * rdiff-backup /home/pcw/Projects /home/pcw/Backup
This system gives me two full copies of my project files and incremental backups to boot.
Todo: rdiff-backup to a different disk, giving three copies.


blat wants crlf's in the input file and cygwin rsync is giving it lf's so I have changed the blatting as follows:
Peter