fix(backup): allow reusing existing backup directory and enhance copy options

This commit is contained in:
dw-0
2025-10-27 09:30:33 +01:00
parent 9c7b5fcb10
commit 48c0ae7227

View File

@@ -109,7 +109,16 @@ class BackupService:
else:
backup_path = self._backup_root.joinpath(backup_dir_name)
shutil.copytree(source_path, backup_path)
if backup_path.exists():
Logger.print_info(f"Reusing existing backup directory '{backup_path}'")
shutil.copytree(
source_path,
backup_path,
dirs_exist_ok=True,
symlinks=True,
ignore_dangling_symlinks=True,
)
Logger.print_ok(
f"Successfully backed up '{source_path}' to '{backup_path}'"