Update verbosity of restic-batch
This commit is contained in:
parent
799055857c
commit
3c84bfe673
@ -72,10 +72,9 @@ class Volume(abc.ABC):
|
|||||||
# --------------------------------------------------------------------------------------
|
# --------------------------------------------------------------------------------------
|
||||||
# Perform the backup.
|
# Perform the backup.
|
||||||
# --------------------------------------------------------------------------------------
|
# --------------------------------------------------------------------------------------
|
||||||
ps = subprocess.run(self._restic_cmd_base + ["backup", "."], cwd=self._backup_path,
|
subprocess.run(self._restic_cmd_base + ["backup", "."], cwd=self._backup_path,
|
||||||
env=self._environ, check=True,
|
env=self._environ, check=True,
|
||||||
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||||
print(ps.stdout.decode("ascii"), flush=True)
|
|
||||||
|
|
||||||
# --------------------------------------------------------------------------------------
|
# --------------------------------------------------------------------------------------
|
||||||
# Forget and prune old snapshots.
|
# Forget and prune old snapshots.
|
||||||
@ -135,6 +134,7 @@ class DatasetMount:
|
|||||||
self.__mountpoint = mountpoint
|
self.__mountpoint = mountpoint
|
||||||
|
|
||||||
def __enter__(self):
|
def __enter__(self):
|
||||||
|
print(f"Mounting {self.__dataset} to {self.__mountpoint}", flush=True)
|
||||||
try:
|
try:
|
||||||
# Bind mounting will preserve the device ID of the snapshot mount. This device ID is
|
# 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
|
# different for every snapshot causing trouble for restic which keeps track of device
|
||||||
@ -150,6 +150,7 @@ class DatasetMount:
|
|||||||
raise
|
raise
|
||||||
|
|
||||||
def __exit__(self, exc_type, exc_value, exc_traceback):
|
def __exit__(self, exc_type, exc_value, exc_traceback):
|
||||||
|
print(f"Unmounting {self.__dataset} from {self.__mountpoint}", flush=True)
|
||||||
try:
|
try:
|
||||||
subprocess.run(["/usr/sbin/zfs", "destroy", "rpool/restic"],
|
subprocess.run(["/usr/sbin/zfs", "destroy", "rpool/restic"],
|
||||||
check=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
check=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||||
|
Loading…
Reference in New Issue
Block a user