Update verbosity of restic-batch

This commit is contained in:
Wojciech Kozlowski 2023-02-25 13:18:25 +01:00
parent 799055857c
commit 3c84bfe673

View File

@ -72,10 +72,9 @@ class Volume(abc.ABC):
# --------------------------------------------------------------------------------------
# Perform the backup.
# --------------------------------------------------------------------------------------
ps = subprocess.run(self._restic_cmd_base + ["backup", "."], cwd=self._backup_path,
env=self._environ, check=True,
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
print(ps.stdout.decode("ascii"), flush=True)
subprocess.run(self._restic_cmd_base + ["backup", "."], cwd=self._backup_path,
env=self._environ, check=True,
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
# --------------------------------------------------------------------------------------
# Forget and prune old snapshots.
@ -135,6 +134,7 @@ class DatasetMount:
self.__mountpoint = mountpoint
def __enter__(self):
print(f"Mounting {self.__dataset} to {self.__mountpoint}", flush=True)
try:
# Bind mounting will preserve the device ID of the snapshot mount. This device ID is
# different for every snapshot causing trouble for restic which keeps track of device
@ -150,6 +150,7 @@ class DatasetMount:
raise
def __exit__(self, exc_type, exc_value, exc_traceback):
print(f"Unmounting {self.__dataset} from {self.__mountpoint}", flush=True)
try:
subprocess.run(["/usr/sbin/zfs", "destroy", "rpool/restic"],
check=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)