]> andersk Git - sql.git/blobdiff - libexec/backup-policy.py
backups: keep less monthlys
[sql.git] / libexec / backup-policy.py
index a05415c0f29577572719d59d7072f0355585f737..85c55cfcfa12e095fd26f43b3509bf27ea3a01b7 100755 (executable)
@@ -11,14 +11,14 @@ backups.reverse()
 backups = [[x, re.match('.*(\d\d\d\d-\d\d-\d\d).*', x)] for x in backups]
 backups = [[x[0], strptime(x[1].groups()[0], '%Y-%m-%d')] for x in backups]
 
-keep = backups[:3]
-backups = backups[3:]
+keep = backups[:2]
+backups = backups[2:]
 monthlys = {}
 for x in backups:
     month = (x[1].tm_year, x[1].tm_mon)
     if month not in monthlys:
         monthlys[month] = x
-    if len(monthlys) > 4:
+    if len(monthlys) > 3:
         break
 keep.extend(monthlys.values())
 
This page took 0.069483 seconds and 4 git commands to generate.