don't act on newest
This commit is contained in:
parent
d39df7274f
commit
2417352b58
@ -326,14 +326,14 @@ def main():
|
||||
desired_count = config.get("copy", {}).get(rule, {}).get("count", 0)
|
||||
|
||||
periods = OrderedDict()
|
||||
for backup in sorted(backups, reverse=True):
|
||||
for backup in sorted(backups):
|
||||
period = pattern(backup.creation.astimezone(pattern_timezone))
|
||||
if period not in periods:
|
||||
periods[period] = deque()
|
||||
periods[period].append(backup)
|
||||
|
||||
to_exec = desired_count
|
||||
ordered_periods = periods.items()
|
||||
ordered_periods = reversed(periods.items())
|
||||
for period, period_backups in ordered_periods:
|
||||
if to_exec == 0:
|
||||
break
|
||||
@ -487,14 +487,14 @@ def main():
|
||||
desired_count = config.get("keep", {}).get(rule, {}).get("count", 0)
|
||||
|
||||
periods = OrderedDict()
|
||||
for backup in sorted(backups, reverse=True):
|
||||
for backup in sorted(backups):
|
||||
period = pattern(backup.creation.astimezone(pattern_timezone))
|
||||
if period not in periods:
|
||||
periods[period] = deque()
|
||||
periods[period].append(backup)
|
||||
|
||||
to_keep = desired_count
|
||||
ordered_periods = periods.items()
|
||||
ordered_periods = reversed(periods.items())
|
||||
for period, period_backups in ordered_periods:
|
||||
if to_keep == 0:
|
||||
break
|
||||
|
||||
Loading…
Reference in New Issue
Block a user