[Borgbackup] Issues understanding prune 'keep' rules

l0f4r0 at tuta.io l0f4r0 at tuta.io
Tue Dec 29 05:40:25 EST 2020


Hi,

Sorry for the late reply.

19 nov. 2020 à 00:47 de jdc at uwo.ca:

> On Nov 18, 2020, l0f4r0--- via Borgbackup <borgbackup at python.org> wrote:
>
>> (I) For me, keep-daily/weekly/monthly/yearly were not supposed to
>> interfere/interlace with each other. I mean, I thought keep-daily rule
>> is applied, then keep-weekly, keep-monthly...
>>
>> (II) But you seem to explain that if a rule is not satisfied, the next
>> ones are evaluated in order to keep archives if applicable, and then
>> the previous rule continues if the conditions are still satisfied and
>> so on...
>> In other words, rules are applied cyclically with precedence until they are used up.
>>
>
> The rules are applied strictly in order.  E.g. in the example in the
> previous message, when the weekly rule runs, it examines each backup
> that is the last in its week, and takes the most recent ones that
> haven't already been kept because of an earlier rule.
>
> Then, the monthly rule runs, and considers each backup that is the
> last in its month, and keeps any that weren't matched by an earlier
> rule like the weekly rule.
>
> In the above example, that causes an interleaving, because the last
> backup in a month is not necessarily the last backup in a week.
>
> This interleaving only happens with weekly backups.  All the other
> ones nest in the expected way, I believe.
>
Thanks for your explanations.

I understand everything you said except the weekly/monthly part (you must be right though as you have succeeded in explaining the whole OP results...).

For me, there is still a contradiction between "The rules are applied strictly in order" & 
"I was surprised at first that the July 29 archive was kept, but since it's the last one in July and wasn't kept by the weekly rule, the monthly rule catches it."

If rules were really applied in order, monthly rules should not be evaluated before every weekly rules have been applied...
> (In any case, I don't think it matters too much.  Borg is so space
> efficient that you should just keep lots of history and not worry
> too much about which ones get pruned.  But it's fun to think about.)
>
+1

> BTW, I think the development version shows which rules cause each
> archive to be kept.
>
> I agree that the example in the web docs would be better if it
> had --keep-weekly 4 in it, to illustrate this.
>
Yes, definitely but it seems to be on purpose.

21 nov. 2020 à 13:51 de dassies at eml.cc:

> On 18 Nov 2020, Dan Christensen wrote:
>
>> BTW, I think the development version shows which rules cause each
>> archive to be kept.
>>
> Interesting! I will have to take a look. It would be handy to have a
> switch to enable this in the regular release.
>
I was not aware but I confirm it would be nice and prevent some questioning ;p

Best regards,
l0f4r0



More information about the Borgbackup mailing list