def markPartialBackupForDeletion(bkHome): """ Looks for any partial backups and marks them for deletion. """ if not os.path.exists(bkHome): return partials = fn.getPartialBackups(bkHome) for partial in partials: partialBackup = os.path.join(bkHome, partial) os.rename(partialBackup, partialBackup.replace(".part", ".delete"))
def test_getPartialBackups(self): backup = join(self._backupHome, "2009-01-24-120729.part") os.makedirs(backup) backups = fn.getPartialBackups(self._backupHome) self.assertTrue(len(backups) == 1)