Index: trunk/backup/worker.py |
— | — | @@ -273,9 +273,16 @@ |
274 | 274 | self.statusComplete() |
275 | 275 | |
276 | 276 | def cleanOldDumps(self): |
277 | | - # Keep the last few |
278 | | - old = self.wiki.dumpDirs()[:-(self.config.keep)] |
| 277 | + old = self.wiki.dumpDirs() |
279 | 278 | if old: |
| 279 | + if old[-1] == self.date: |
| 280 | + # If we're re-running today's dump, don't count it as one |
| 281 | + # of the old dumps to keep... or delete it halfway through! |
| 282 | + old = old[:-1] |
| 283 | + if self.config.keep > 0: |
| 284 | + # Keep the last few |
| 285 | + old = old[:-(self.config.keep)] |
| 286 | + if old: |
280 | 287 | for dump in old: |
281 | 288 | self.status("Purging old dump %s for %s" % (dump, self.dbName)) |
282 | 289 | base = os.path.join(self.wiki.publicDir(), dump) |