Skip to content

Commit

Permalink
make use of exclude
Browse files Browse the repository at this point in the history
  • Loading branch information
creatorcary committed Nov 7, 2024
1 parent 8c146c7 commit cfa6570
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/middlewared/middlewared/plugins/cloud_backup/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from middlewared.utils.time_utils import utc_now


async def restic(middleware, job, cloud_backup, dry_run):
async def restic_backup(middleware, job, cloud_backup, dry_run):
await middleware.call("network.general.will_perform_activity", "cloud_backup")

snapshot = None
Expand Down Expand Up @@ -64,6 +64,9 @@ async def restic(middleware, job, cloud_backup, dry_run):
if dry_run:
cmd.append("-n")

for excl in cloud_backup["exclude"]:
cmd.extend(["--exclude", excl])

restic_config = get_restic_config(cloud_backup)

cmd = restic_config.cmd + ["--verbose", "backup"] + cmd
Expand Down Expand Up @@ -122,7 +125,7 @@ async def _sync(self, cloud_backup, options, job):
try:
await self.middleware.call("cloud_backup.ensure_initialized", cloud_backup)

await restic(self.middleware, job, cloud_backup, options["dry_run"])
await restic_backup(self.middleware, job, cloud_backup, options["dry_run"])

job.set_progress(100, "Cleaning up")
restic_config = get_restic_config(cloud_backup)
Expand Down

0 comments on commit cfa6570

Please sign in to comment.