make exclude dirs optional

This commit is contained in:
Thies Lennart Alff 2025-01-07 22:17:32 +01:00
parent d23b5a4a4d
commit 15979acd5c
Signed by: lennartalff
GPG key ID: 4EC67D34D594104D

View file

@ -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,