Bug 7889 - Add "--backup-deleted"
Summary: Add "--backup-deleted"
Status: ASSIGNED
Alias: None
Product: rsync
Classification: Unclassified
Component: core (show other bugs)
Version: 3.0.7
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---
Assignee: Wayne Davison
QA Contact: Rsync QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-26 16:53 UTC by Jonathan Kamens
Modified: 2011-04-09 16:44 UTC (History)
0 users

See Also:


Attachments
patch to add --backup-deleted (5.87 KB, patch)
2010-12-26 16:54 UTC, Jonathan Kamens
no flags Details
new patch (against rsync 3.0.8) to add --backup-deleted (5.75 KB, patch)
2011-04-03 05:17 UTC, Jonathan Kamens
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Kamens 2010-12-26 16:53:42 UTC
I am using rsync in a way where I very much want deleted destination files to be backed up, but I very much do not want modified destination files to be backed up. In particular, I want to "shred" deleted files, and the easiest way to do that is to give them a backup prefix and then go through all the files with that prefix after rsync is done and shred them. The reason why it is important for me to only back up deleted files is because I am doing rsync to an s3backer filesystem, and my upload bandwidth is low, so if I back up modified files in addition to deleted ones, then rsync has to write a lot more data to the s3backer filesystem, which make the backup run much more slowly and also costs me more money in s3backer usage fees. The fact that I am using s3backer is also why I want to shred (with -z) the deleted files, because if I overwrite them with nulls, the relevant blocks will be deleted on the s3backer filesystem, thus saving me money in s3backer usage fees.

I added a new flag to rsync to do what I need: --backup-deleted, which backs up deleted files without backing up modified ones. I think this functionality is generally useful enough that it is worth incorporating into the official rsync distribution.

Please note: this introduces a protocol incompatibility, which I have NOT dealt with in my patch, because I don't understand the ins and outs of how this works and I'm pretty sure the rsync maintainers will be able to figure this part out a lot faster and more correctly then I can.

I am attaching to this bug report my patch for adding --backup-deleted support. Thank you for considering my patch.
Comment 1 Jonathan Kamens 2010-12-26 16:54:17 UTC
Created attachment 6169 [details]
patch to add --backup-deleted
Comment 2 Jonathan Kamens 2011-04-03 05:11:22 UTC
Would love to hear your thoughts about this feature. Any chance of getting it in?
Comment 3 Jonathan Kamens 2011-04-03 05:17:48 UTC
Created attachment 6368 [details]
new patch (against rsync 3.0.8) to add --backup-deleted
Comment 4 Wayne Davison 2011-04-09 16:44:21 UTC
Thanks!  I have adapted your patch for 3.1.0dev and put it in the patches directory.  I'm considering including it in the 3.1.0 release.

Some notes on the changes I made in the official patch:

 - The option sending was enhanced to send -b to a remote sender, even if the local receiver is using --backup-deleted (making it more backward-compatible).  A remote receiver gets both -b and --backup-deleted, which is fine since the latter overrides the former.

 - Doc changes need to patch rsync.yo (which generates rsync.1).

Otherwise everything looked great.  The changes are nice and simple, which makes me lean toward accepting this as a new option.