Print only on error syncoid-batch

This commit is contained in:
Wojciech Kozlowski 2023-02-11 10:27:34 +01:00
parent 479df53e7a
commit 2b197879b5

View File

@ -47,4 +47,9 @@ if __name__ == "__main__":
syncoid_cmd.append(config["dataset"])
syncoid_cmd.append(config["backup_dataset"])
subprocess.run(syncoid_cmd, check=True)
try:
subprocess.run(syncoid_cmd, check=True,
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
except subprocess.CalledProcessError as err:
print(err.stdout.decode("ascii"), flush=True)
raise