diff --git a/backup_manager.py b/backup_manager.py index 24c2a3b..e7ec427 100644 --- a/backup_manager.py +++ b/backup_manager.py @@ -32,8 +32,10 @@ class BackupManager: borg_env["BORG_PASSPHRASE"] = remote["BORG_PASSPHRASE"] repo = f"ssh://{backup_user}@{remote_host}/{repo_prefix}/{local_host}/{repo_subdir}::{{{time_format}}}" cmd = ( - f"borg create -v --stats {repo} {backup_dirs} --exclude {exclude_dirs}" + f"borg create -v --stats {repo} {backup_dirs}" ) + if exclude_dirs: + cmd += f" --exclude {exclude_dirs}" try: result = subprocess.run( cmd,