--min/max-size affects only transfer, not --delete, why?

Matt McCutchen hashproduct at verizon.net
Fri Feb 24 22:05:25 GMT 2006


On Fri, 2006-02-24 at 12:19 -0400, bulia byak wrote:
> Logically, deleting the dst file which does not exist on src amounts
> to "transferring the non-existence" of that file from src to dst.
> Therefore, if files larger or smaller than some size are ignored in
> transfer, they must just as well be ignored in deleting (much as
> --exclude'd files are also excluded from delete, unless you specify
> --delete-excluded). So I think the behavior should be amended by
> checking the sizes of dst-only files and applying the same min/max
> filters to them when deciding whether to delete them or not.

I disagree.  --min-size and --max-size filter based on the size on the
_sender_, and a file not present on the sender has no size to check
against these options.

If you want to protect small or large files from being deleted on the
receiver, run find on the receiver ahead of time to make a list of them,
use sed to turn the filenames into protect filters (P /foo), and pass
the filters to rsync.
-- 
Matt McCutchen
hashproduct at verizon.net
http://hashproduct.metaesthetics.net/



More information about the rsync mailing list