From 108cc55ca1b17d00b54f006aefd5d21b78916835 Mon Sep 17 00:00:00 2001 From: David Piggott Date: Fri, 27 Mar 2015 19:23:16 +0000 Subject: [PATCH] Guard via idempotency against termination between migration operations --- management/backup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/management/backup.py b/management/backup.py index cc41ad2d..361bb0f1 100755 --- a/management/backup.py +++ b/management/backup.py @@ -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