Guard via idempotency against termination between migration operations

This commit is contained in:
David Piggott 2015-03-27 19:23:16 +00:00
parent 2726b15764
commit 108cc55ca1
1 changed files with 1 additions and 1 deletions

View File

@ -183,8 +183,8 @@ def perform_backup(full_backup):
backup_duplicity_dir = os.path.join(backup_dir, 'duplicity')
migrated_unencrypted_backup_dir = os.path.join(env["STORAGE_ROOT"], "migrated_unencrypted_backup")
if os.path.isdir(backup_duplicity_dir):
shutil.move(backup_duplicity_dir, migrated_unencrypted_backup_dir)
shutil.rmtree(backup_encrypted_dir)
shutil.move(backup_duplicity_dir, migrated_unencrypted_backup_dir)
# On the first run, always do a full backup. Incremental
# will fail. Otherwise do a full backup when the size of