Alway create the backup directory

This commit is contained in:
Spitap
2025-11-01 17:33:54 +01:00
parent d6c70fba1d
commit a81cd4196c
2 changed files with 4 additions and 1 deletions

View File

@@ -173,6 +173,7 @@ class Installer:
if self.with_db: if self.with_db:
self._dump_database(path) self._dump_database(path)
custom_backup_path = os.path.join(path, "custom", self.appname) custom_backup_path = os.path.join(path, "custom", self.appname)
utils.mkdir_safe(custom_backup_path)
self.custom_backup(custom_backup_path) self.custom_backup(custom_backup_path)
def custom_backup(self, path): def custom_backup(self, path):

View File

@@ -135,5 +135,7 @@ class Opendkim(base.Installer):
def custom_backup(self, path): def custom_backup(self, path):
"""Backup DKIM keys.""" """Backup DKIM keys."""
if os.path.isdir(self.app_config["keys_storage_dir"]): if os.path.isdir(self.app_config["keys_storage_dir"]):
shutil.copytree(self.app_config["keys_storage_dir"], path) shutil.copytree(
self.app_config["keys_storage_dir"], path, dirs_exist_ok=True
)
utils.printcolor("DKIM keys saved!", utils.GREEN) utils.printcolor("DKIM keys saved!", utils.GREEN)