mirror of
https://github.com/netinvent/npbackup.git
synced 2025-11-11 14:42:37 +08:00
CLI: dump should output binary data straight to stdout
This commit is contained in:
parent
b206ba9acf
commit
77b1ce4e20
1 changed files with 3 additions and 0 deletions
|
|
@ -1379,6 +1379,9 @@ class ResticRunner:
|
||||||
# Also, don't use poller method which is too slow
|
# Also, don't use poller method which is too slow
|
||||||
result, output = self.executor(cmd, encoding=False, method="monitor")
|
result, output = self.executor(cmd, encoding=False, method="monitor")
|
||||||
if result:
|
if result:
|
||||||
|
# We need to write binary data directly to stdout on success
|
||||||
|
# Dump should only be used by CLI
|
||||||
|
sys.stdout.buffer.write(output)
|
||||||
msg = f"File {path} successfully dumped"
|
msg = f"File {path} successfully dumped"
|
||||||
else:
|
else:
|
||||||
msg = f"Cannot dump file {path}:\n {output}"
|
msg = f"Cannot dump file {path}:\n {output}"
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue