A couple of quick notes follow the download links and then there is an example.
The easiest way to install rsync on Windows is to use DeltaCopy. There are many useful articles about installing DeltaCopy but this link is useful as well.
===Note 1 –link-dest and DeltaCopy Server ===============
I was trying to get DeltaCopy to take the –link-dest parameter using relative paths to go up a couple of directories. It wouldn’t work. Experimentation showed me that it’s something to do with the DeltaCopy Server, not the DeltaCopy client.
Here’s what I tried that worked with a batch file (Windows XP) (Watch for line wraps)
rsync.exe -v -rlt –perms –delete “–link-dest=../../Daily/1/” “/cygdrive/G/BackupSequentially/Test Files” “/cygdrive/G/BackupSequentially/Vault/Hourly/0/”
Here’s what didn’t work:
rsync.exe -v -rlt –perms –delete “–link-dest=../../Daily” “/cygdrive/G/BackupSequentially/Test Files” “office::BackupHourly/”
The end of that last line represents the DeltaCopy Server address. I’m guessing it’s going to do that whether using DeltaCopy or just an rsync daemon .
The parameter will work if the linked folder is in the same folder as the destination, but that’s not helpful really. When the relative path is used the Server gets totally confused.
So, for this backup project I’ll use a straight command line to run the backup instead of DeltaCopy since I’m running this on the local LAN. For remote backups I won’t use the –link-dest parameter so I can use the SSH feature of DelatCopy client.
===Note 2 Trailing Slashes=====================
Slashes must be used very carefully. Here are some things I’ve learned about them.
–link-dest needs a trailing slash, apparently always
If there is no trailing slash after source and destination the command will rebuild source root folder in destination
———————
“/cygdrive/G/BackupSequentially/Test Files” “/cygdrive/G/BackupSequentially/Vault/Hourly/0/”
Note no trailing slash after source, left destination with a <Test Files> folder
———————
“/cygdrive/G/BackupSequentially/Test Files/” “/cygdrive/G/BackupSequentially/Vault/Hourly/0/”
Note a trailing slash after source, left destination without a <Test Files> folder
———————
“/cygdrive/G/BackupSequentially/Test Files/” “/cygdrive/G/BackupSequentially/Vault/Hourly/0”
Note no trailing slash after destination, left destination with a <Test Files> folder
The trailing slash after the destination doesn’t seem to make a difference, but I could be wrong.
——————–
My final example
>>>>>>>>>>>>>>>>>>>>>
Example of rsync with –link-dest and TCP address for destination, no security (SSH)
Directory structure
\\192.168.1.83\BackupSequentially\Vault\Hourly\0
\\192.168.1.83\BackupSequentially\Vault/Daily\0
Purpose: Copy <Test Files> to <Hourly\0> with hard links to <Daily\0> if files already exist there
Note: rsync command uses “/” instead of windows “\”
rsync.exe -v -rlt –perms –delete “–link-dest=../../Daily/0/” “/cygdrive/G/BackupSequentially/Test Files” “//192.168.1.83/BackupSequentially/Vault/Hourly/0”
>>>>>>>>>>>>>>>>>>>>>
I use a more extensive AutoIT script to do multiple hourly and daily backups using the above principle