rsync to ONLY keep files in destination that have been removed from source

Posted by David Corley on Server Fault See other posts from Server Fault or by David Corley
Published on 2012-06-26T11:59:23Z Indexed on 2012/06/26 15:18 UTC
Read the original article Hit count: 228

Filed under:

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?

© Server Fault or respective owner

Related posts about rsync