make exclude dirs optional
This commit is contained in:
parent
d23b5a4a4d
commit
15979acd5c
1 changed files with 3 additions and 1 deletions
|
|
@ -32,8 +32,10 @@ class BackupManager:
|
||||||
borg_env["BORG_PASSPHRASE"] = remote["BORG_PASSPHRASE"]
|
borg_env["BORG_PASSPHRASE"] = remote["BORG_PASSPHRASE"]
|
||||||
repo = f"ssh://{backup_user}@{remote_host}/{repo_prefix}/{local_host}/{repo_subdir}::{{{time_format}}}"
|
repo = f"ssh://{backup_user}@{remote_host}/{repo_prefix}/{local_host}/{repo_subdir}::{{{time_format}}}"
|
||||||
cmd = (
|
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:
|
try:
|
||||||
result = subprocess.run(
|
result = subprocess.run(
|
||||||
cmd,
|
cmd,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue