From 6954490bf4e411a1c443d71e9c2ab85c878f805b Mon Sep 17 00:00:00 2001 From: Wojciech Kozlowski Date: Sat, 4 Nov 2023 21:39:03 +0100 Subject: [PATCH] Do not initialise buckets from restic-batch --- .../backups/restic/setup/files/restic-batch | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/playbooks/roles/backups/restic/setup/files/restic-batch b/playbooks/roles/backups/restic/setup/files/restic-batch index e1b41f8..77d9c55 100644 --- a/playbooks/roles/backups/restic/setup/files/restic-batch +++ b/playbooks/roles/backups/restic/setup/files/restic-batch @@ -53,21 +53,11 @@ class Volume(abc.ABC): try: # -------------------------------------------------------------------------------------- - # Check if bucket exists. If not, create and initialise the bucket. + # Check if bucket exists. # -------------------------------------------------------------------------------------- - try: - subprocess.run(self._restic_cmd_base + ["snapshots"], - env=self._environ, check=True, - stdout=subprocess.PIPE, stderr=subprocess.STDOUT) - except subprocess.CalledProcessError as snapshots_err: - try: - ps = subprocess.run(self._restic_cmd_base + ["init"], - env=self._environ, check=True, - stdout=subprocess.PIPE, stderr=subprocess.STDOUT) - print(ps.stdout.decode("ascii"), flush=True) - except subprocess.CalledProcessError: - print(snapshots_err.stdout.decode("ascii"), flush=True) - raise + subprocess.run(self._restic_cmd_base + ["snapshots"], + env=self._environ, check=True, + stdout=subprocess.PIPE, stderr=subprocess.STDOUT) # -------------------------------------------------------------------------------------- # Perform the backup.