Do not initialise buckets from restic-batch

This commit is contained in:
Wojciech Kozlowski 2023-11-04 21:39:03 +01:00
parent 2e32ea5c5d
commit 6954490bf4

View File

@ -53,21 +53,11 @@ class Volume(abc.ABC):
try: try:
# -------------------------------------------------------------------------------------- # --------------------------------------------------------------------------------------
# Check if bucket exists. If not, create and initialise the bucket. # Check if bucket exists.
# -------------------------------------------------------------------------------------- # --------------------------------------------------------------------------------------
try: subprocess.run(self._restic_cmd_base + ["snapshots"],
subprocess.run(self._restic_cmd_base + ["snapshots"], env=self._environ, check=True,
env=self._environ, check=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
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
# -------------------------------------------------------------------------------------- # --------------------------------------------------------------------------------------
# Perform the backup. # Perform the backup.