]> andersk Git - sql.git/blobdiff - libexec/backup-policy.py
Keep fewer backups
[sql.git] / libexec / backup-policy.py
index 94e97c3d1850a3056704b73226e977e97068f5d4..a05415c0f29577572719d59d7072f0355585f737 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[:4]
-backups = backups[4:]
+keep = backups[:3]
+backups = backups[3:]
 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) > 5:
+    if len(monthlys) > 4:
         break
 keep.extend(monthlys.values())
 
This page took 0.456718 seconds and 4 git commands to generate.