mirror of
https://github.com/borgbackup/borg.git
synced 2026-04-15 21:59:58 -04:00
Keep oldest archive when retention target is not met
This commit is contained in:
parent
9ee96763e2
commit
943088df2c
1 changed files with 4 additions and 0 deletions
|
|
@ -58,6 +58,10 @@ def prune_split(archives, rule, n, kept_because=None):
|
|||
kept_because[a.id] = (rule, len(keep))
|
||||
if len(keep) == n:
|
||||
break
|
||||
# Keep oldest archive if we didn't reach the target retention count
|
||||
if len(keep) < n and a.id not in kept_because:
|
||||
keep.append(a)
|
||||
kept_because[a.id] = (rule+"[oldest]", len(keep))
|
||||
return keep
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue