To backup windows using rdiff-backup to another computer, four sub-systems need to be configured:
- Install cygwin (including rdiff-backup) on the windows machine
- Configure and test rdiff-backup across ssh using manual passwords
- Configure public key authentication for passwords
- Configure scheduled tasks to run the process automatically
1. Install cygwin
Just follow the instructions on http://cygwin.org and remember to include rdiff-backup (and rsync if you need it)
2. Configure and test rdiff-backup
Here is my script:
rdiff-backup /cygdrive/c/Common jordan-backup::/backup/stillwater/Common
rdiff-backup /cygdrive/c/Users\ Shared\ Folders jordan-backup::/backup/stillwater/UsersSharedFolders
rdiff-backup --exclude-globbing-filelist sw-exclude.txt /cygdrive/c jordan-backup::/backup/stillwater/c
This assumes that there is an "exclude" file in the same directory in which the program is run from. See at the end for mine. I also wanted to do a database dump into a directory that would be backed up. Here is my dump command:
'/cygdrive/c/Program Files/MySQL/MySQL Server 5.0/bin/mysqldump.exe' -u xxxx -p --compress --add-drop-table --extended-insert -A > /cygdrive/c/Common/MySQLBackup/stillwater.sql
3. Configure public key authentication
An excellent tutorial for this is available on: http://arctic.org/~dean/rdiff-backup/unattended.html
(A cached version is available here.)
4. Configure scheduled tasks
Create a file called daily-backup.bat (the --login creates path and environment variables):
C:\cygwin\bin\bash --login \common\scripts\rdiff.sh
Create a file called rdiff.sh (which must have unix line endings):
#!/bin/bash
rdiff-backup commands... (as tested above)
sw-exclude.txt
/cygdrive/c/backup
/cygdrive/c/Common
/cygdrive/c/Users?Shared?Folders
/cygdrive/c/download
/cygdrive/c/TEMP
/cygdrive/c/pagefile.sys
/cygdrive/c/WINDOWS/system32/config
/cygdrive/c/WINDOWS/system32/wins
ignorecase:/cygdrive/c/**ntuser.dat
ignorecase:/cygdrive/c/**UsrClass.dat
ignorecase:/cygdrive/c/**/*.dat.log
/cygdrive/c/Program Files/Exchsrvr
/cygdrive/c/Program Files/Microsoft?SQL?Server
/cygdrive/c/System?Volume?Information
/cygdrive/c/WINDOWS/NTDS
/cygdrive/c/WINDOWS/ntfrs
/cygdrive/c/WINDOWS/Debug
/cygdrive/c/WINDOWS/SoftwareDistribution/EventCache
/cygdrive/c/**/*webpam.lck