I'm trying to use rsync and "--link-dest=" to create incremental copies of backups on a server (Debian Wheezy, LVM, RAID 1), with the goal of using hard links to save space.
Unlike what may be the "normal" use case, I want to back up every day from a windows client to a folder on the server called "1" (this part works, though I don't use rsync here to do the backup), and then rsync off of "1" to create 30 days worth of incremental changes. So "1" changes with each day's backup from the client, but the copies made off of it would contain older file versions, 30 days worth.
From a post at http://blog.interlinked.org/tutorials/rsync_time_machine.html which outlines how to use rsync to simulate what Apple's Time Machine does, I have the following code (the "15/16" part of the target path represent the day/time of the backup):
date=`date "+%Y-%m-%dT%H:%M:%S"` $UserNameVar=client8 rsync -aP --log-file=/home/User1/Desktop/rsync.log --link-dest=/home/$UserNameVar/share/Backups/1/current /home/$UserNameVar/share/Backups/1 /home/$UserNameVar/share/Backups/15/16/back-$date rm -f /home/$UserNameVar/share/Backups/1/current ln -s back-$date /home/$UserNameVar/share/Backups/1/current
The code runs, the backup occurs, the link between the last backup and "current" is created, and the subsequent backups are very fast, but as best I can tell, the backups consume the same space as the original.
Is the approach flawed, or something in my code wrong? Or do I need a different way to calculate the actual free space?