Given rsync --link-dest, is it possible to determine which files were linked and which are new?
I'm using rsync --link-dest
to preform a differential back up of my computer. After each backup, I'd like to sav开发者_开发知识库e out a log of the new/changed files. Is this possible? If so, how would I do it?
Answer from the rsync mailing list:
Use --itemize-changes
Here's another answer from the mailing list. There's a script by Kevin Korb:
If you want something you can run after the fact here is a tool I wrote a while back that does a sort of diff across 2 --link-dest based backups:
http://sanitarium.net/unix_stuff/rspaghetti_backup/diff_backup.pl.txt
It will also tell you what files were not included in the newer backup which --itemize-changes will not since it doesn't actually --delete anything. The program is written in perl so it should be easy enough to tweak it if it doesn't do exactly what you want.
For referance you can also compare using rsync to do a dryrun between hardlinked backup directories to see how they are changed.
rsync -aHin day_06_*/ day_05_* 2>&1 | grep -v '^\.d'
Shows files that are added, removed, or renamed//moved.
The later only happens if you have a re-linking program relinking files that were renamed/moved. That can be important if you say had simply renamed a directory (rsync backup breaks the links in that case).
精彩评论