DO NOT REPLY [Bug 3824] Max-delete with percentage

samba-bugs at samba-bugs at
Tue Jun 6 22:28:56 GMT 2006

------- Comment #1 from hashproduct+rsync at  2006-06-06 17:28 MST -------
A percentage --max-delete would be difficult to implement.  The generator would
need to know the total number of files in the target directory in order to
decide whether to delete or skip deleting the first extraneous file.  The files
could be counted in a separate pass during startup and deleted during the main
pass, or they could be counted during the main pass for deletion in a separate
pass at the end of the transfer.

Do you have a specific case in which a percentage --max-delete would be useful?
  If not, the above sounds like a lot of mess for a minor improvement.

Instead, a numeric max-delete could be calculated from a percentage outside of
rsync using a find command:
  rsync <options> src/ dest/ \
    --max-delete=$(($(find dest/ -printf x | wc -c)*$percent/100))
It would take more work to omit files protected from deletion by filters from
the total.

Configure bugmail:
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.

More information about the rsync mailing list