I currently backup using Makedirdiff through a script that I hacked together to compare the content of my data directories with the previous full backup directory and produce a new directory structure of the incrementals only, with a top level directory name that dateandtimestamps the backup and updates the full backup directory. As it runs, the full-backup directory is updated to reflect the newest changed files (nothing is ever deleted) and each incremental directory structure only shows the changed files, therefore is small enough to encrypt and backup onto cloud storage or burn to cds as needed, with a monthly copy of the latest full-backup file directory.
I am interested in replacing this with an rsync script. There is a very good tutorial showing an example at:
http://webgnuru.com/linux/rsync_incremental.php which compares a source directory (my working directory) with a target directory (initially empty and built up each day as an incremental) and a link-destination directory (the previous days incremental backup) such that anything newer in the source than in the link-dir is written to the new target.
However, my issue is that this design does not isolate the changed files into a separate directory tree. The description in that tutorial states that:
This implies that each incremental directory structure contains the changed files and a hard-link to every unchanged file. This appears to leave each of the incremental directories as the equivalent of my previous full backup - i.e. with the full file lists from the master directory, even if the hard links are really only pointers to the same physical file space as the original files. When it comes to copying this structure to permanent storage (e.g. cd), is there a way to only select the genuinely changed files, i.e. those without hard links?Additionally, unchanged files are hard linked from the link destination directory to the target directory.
Or as a better alternative, is there a flag/option to run rsync in incremental mode such that it still compares to the link-dir content but only writes the changed files to the target-dir. This could be an extra step, such that one pass writes an incremental only directory, and a second pass (with slightly different options) produces the changes plus hard-links directory to be used as the link-dir on the following day.
Are there any rsync gurus who know how to do this?
[Mods - sorry... I think this should be in Scripts & Bash ]