diff --git a/src/middlewared/middlewared/plugins/cloud_backup/sync.py b/src/middlewared/middlewared/plugins/cloud_backup/sync.py index e1f3e33d211d..100a5fb3ad05 100644 --- a/src/middlewared/middlewared/plugins/cloud_backup/sync.py +++ b/src/middlewared/middlewared/plugins/cloud_backup/sync.py @@ -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 @@ -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 @@ -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)