mirror of
https://github.com/mail-in-a-box/mailinabox.git
synced 2025-04-22 03:06:55 +00:00
Guard via idempotency against termination between migration operations
This commit is contained in:
parent
2726b15764
commit
108cc55ca1
@ -183,8 +183,8 @@ def perform_backup(full_backup):
|
|||||||
backup_duplicity_dir = os.path.join(backup_dir, 'duplicity')
|
backup_duplicity_dir = os.path.join(backup_dir, 'duplicity')
|
||||||
migrated_unencrypted_backup_dir = os.path.join(env["STORAGE_ROOT"], "migrated_unencrypted_backup")
|
migrated_unencrypted_backup_dir = os.path.join(env["STORAGE_ROOT"], "migrated_unencrypted_backup")
|
||||||
if os.path.isdir(backup_duplicity_dir):
|
if os.path.isdir(backup_duplicity_dir):
|
||||||
shutil.move(backup_duplicity_dir, migrated_unencrypted_backup_dir)
|
|
||||||
shutil.rmtree(backup_encrypted_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
|
# On the first run, always do a full backup. Incremental
|
||||||
# will fail. Otherwise do a full backup when the size of
|
# will fail. Otherwise do a full backup when the size of
|
||||||
|
Loading…
Reference in New Issue
Block a user