From e1379bc480b71a9566240a8d9ece859493192423 Mon Sep 17 00:00:00 2001 From: Anton Vakhrushev Date: Sat, 20 Dec 2025 21:33:21 +0300 Subject: [PATCH] Backup: roots parameter --- files/backups/backup-all.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/files/backups/backup-all.py b/files/backups/backup-all.py index a327127..b585778 100644 --- a/files/backups/backup-all.py +++ b/files/backups/backup-all.py @@ -161,11 +161,12 @@ class ResticStorage(Storage): class BackupManager: - def __init__(self, config: Config, storages: List[Storage]): + def __init__(self, config: Config, roots: List[Path], storages: List[Storage]): self.errors: List[str] = [] self.warnings: List[str] = [] self.successful_backups: List[str] = [] self.config = config + self.roots: List[Path] = roots self.storages = storages def _select_telegram(self) -> Optional[TelegramConfig]: @@ -176,7 +177,7 @@ class BackupManager: def find_applications(self) -> List[Application]: """Get all application directories and their owners.""" applications: List[Application] = [] - source_dirs = itertools.chain(*(root.iterdir() for root in self.config.roots)) + source_dirs = itertools.chain(*(root.iterdir() for root in self.roots)) for app_dir in source_dirs: if "lost+found" in str(app_dir): @@ -467,7 +468,7 @@ def initialize(config_path: Path) -> BackupManager: config = Config(roots=roots, notifications=notifications) - return BackupManager(config=config, storages=storages) + return BackupManager(config=config, roots=roots, storages=storages) def main():