fixed mail backup/restore
This commit is contained in:
@@ -31,7 +31,7 @@ class Backup():
|
||||
def __init__(self, config, bashArg, nomail):
|
||||
self.config = config
|
||||
self.destinationPath = ""
|
||||
self.BACKUPDIRECTORY = ["mails/", "custom/", "databases/"]
|
||||
self.BACKUPDIRECTORY = ["custom/", "databases/"]
|
||||
self.nomail = nomail
|
||||
self.isBash = False
|
||||
self.bash = ""
|
||||
@@ -126,7 +126,7 @@ class Backup():
|
||||
f" ({home_path}) seems not right...", utils.RED)
|
||||
|
||||
else:
|
||||
dst = self.destinationPath + self.BACKUPDIRECTORY[0] + "vmail/"
|
||||
dst = self.destinationPath + "mails/"
|
||||
|
||||
if os.path.exists(dst):
|
||||
shutil.rmtree(dst)
|
||||
|
||||
@@ -90,7 +90,11 @@ class Dovecot(base.Installer):
|
||||
"""Additional tasks."""
|
||||
if self.restore and len(os.listdir(self.restore + "mails")) > 0:
|
||||
utils.printcolor("Copying mail backup over dovecot directory", utils.MAGENTA)
|
||||
shutil.copytree(self.restore+"mails/vmails", self.home_dir, dirs_exist_ok=True)
|
||||
|
||||
if os.path.exists(self.home_dir):
|
||||
shutil.rmtree(self.home_dir)
|
||||
|
||||
shutil.copytree(self.restore+"mails/", self.home_dir)
|
||||
elif self.restore:
|
||||
utils.printcolor("It seems that mails were not backed up, skipping mail restoration.", utils.MAGENTA)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user