<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta content="text/html;charset=UTF-8" http-equiv="Content-Type"></head><body ><div style="font-size: 10pt; font-family: Verdana, Arial, Helvetica, sans-serif;"><div><div>I think you would implement it as a new type of filter rule. similar to 'P' (preserve) but with a timestamp or delta-time to define what counts as 'recent' as well as the pattern to match for this rule to apply (which could just be a wildcard matching anything by default, but could also use the full pattern-matching capabilities if required).<br></div><div><br></div><div>Have a look at:<br></div><ol><li>the 'make_backups' logic in parse_arguments(), where it adds a 'Preserve' pattern to match all backup files,<br></li><li>name_is_excluded() and its subfunctions check_filter() and rule_matches() in exclude.c<br></li></ol><div>You'd need to:<br></div><ul><li>define a new filter-type character ('R' for preserve-Recent?)<br></li><li>define the format of the filter rule for this type e.g. how to represent the time<br></li><li>add code to parse this new ruletype in rule_matches()<br></li><li>decide how your new option interacts with existing filter rules (higher or lower precedence, degree of specificity, etc)<br></li><li>add code to insert one or more rules of the new type into the filter list in appropriate positions<br></li></ul><div>Also:<br></div><ul><li>bump the protocol revision number, because an old rsync wouldn't understand the new ruletype<br></li><li>decide what to do in the case where one side is using the older protocol (e.g. treat it as traditional --delete, or don't delete at all?).<br></li></ul><div>So not trivial, but not impossibly difficult, and at least the changes would be fairly localised. <br></div><div><br></div><div>Hope this helps,<br></div><div>.Dave.<br></div><div id="Zm-_Id_-Sgn"><p style=""><span class="colour" style="color:rgb(42, 42, 42)">Sent using <a target="_blank" href="https://www.zoho.com/mail/" style="color:#598fde;">Zoho Mail</a></span><br></p></div><div><br></div><div style="" class="zmail_extra"><div id="Zm-_Id_-Sgn1">---- On Fri, 22 Mar 2019 06:02:33 +0000 <b>Francois Payette via rsync <rsync@lists.samba.org></b> wrote ----<br></div><div><br></div><blockquote style="border-left: 1px solid rgb(204, 204, 204); padding-left: 6px; margin: 0px 0px 0px 5px;"><div><div>Kudos all that maintain this awesome and enduring piece of software. Awesome job, many thanks. <br></div><div><br></div><div>I’ve come across a use case that would greatly benefit form a —delete-older-than <secs> argument. This would behave the same as —delete only sparing files dest that have a creating time less than <secs> ago. How hard would this be to implement? Where would I start ? <br></div><div><br></div><div>TIA, <br></div><div>Francois <br></div><div>-- <br></div><div>Please use reply-all for most replies to avoid omitting the mailing list. <br></div><div>To unsubscribe or change options: <a target="_blank" href="https://lists.samba.org/mailman/listinfo/rsync">https://lists.samba.org/mailman/listinfo/rsync</a> <br></div><div>Before posting, read: <a target="_blank" href="http://www.catb.org/~esr/faqs/smart-questions.html">http://www.catb.org/~esr/faqs/smart-questions.html</a> <br></div></div></blockquote></div><div><br></div></div><div><br></div></div><br></body></html>