]> andersk Git - sql.git/commitdiff
Keep fewer backups
authorQuentin Smith <quentin@mit.edu>
Mon, 8 Mar 2010 04:20:28 +0000 (04:20 +0000)
committerQuentin Smith <quentin@mit.edu>
Mon, 8 Mar 2010 04:20:28 +0000 (04:20 +0000)
git-svn-id: svn://presbrey.mit.edu/sql@182 a142d4bd-2cfb-0310-9673-cb33a7e74f58

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.058939 seconds and 5 git commands to generate.