rsync to ONLY keep files in destination that have been removed from source
- by David Corley
We use rsync to copy filesystem contents from one machine to another as a backup.
We first run MACHINE-X-MACHINE-Y rsync for a straight backup with the --delete and --delete-excluded switches
We also run an internal Rsync between the MACHINE-Y destination, and another folder on MACHINE-Y with either of the delete flags. This maintains a non-destructive copy in the event someone inadvertently deletes a file on MACHINE-X. However, it also has the overhead of being a complete copy of what has already been synchronized.
Ideally I want to be able to run the non-destructive rsync in such a way that the destination ONLY receives the deleted files and so avoids unnecessary duplication . Is there any way to do this?