Restore only changed files with duplicity
I've a problem. Duplicity is perfect for backups, I love so much that can be able to do incremental diff tars, but ... when restoring duplicity seems don't apply same concept.
Basically I need to restore only changed files (obviously after a full backup) but I can't figure how do that.
When I try to restore a directory I get:
Restore destination directory /Volumes/Data/Backups/Srv1 already exists.
I need to backup a directory (and I don't have any problems in doing that) and setup a mirror on another machine.
Thanks!
Solution 1:
Even though this is three years old, I'm just putting this here for anyone in the future who finds this question, like I did.
If you're wanting to completely replace a directory, or restore it from it's previous state, first delete it, then restore with duplicity.
From https://help.ubuntu.com/community/DuplicityBackupHowto:
Either the file must be deleted prior to running the script, or a different path or file name must be used. That behavior is fine for me since I normally like to check out the restored file first instead of just overwriting the current file with the one found in the backup set.
There is no way to restore "only changed files", but deleting it and restoring the directory has the exact same effect, because the files that weren't changed will just be the same after restoring.
You should probably verify the backup's integrity before doing this though, because if you delete files that weren't changed, and then the backup is corrupted, you've just lost previously valid files.