|
|
@@ -9,6 +9,7 @@ import os |
|
|
|
import re |
|
|
|
import sys |
|
|
|
import stat |
|
|
|
import time |
|
|
|
import pathlib |
|
|
|
import subprocess |
|
|
|
|
|
|
@@ -254,9 +255,19 @@ def main(argv: list[str]): |
|
|
|
stdin=subprocess.PIPE) |
|
|
|
if borg.stdin is None: |
|
|
|
raise Exception("no pipe") |
|
|
|
backup.run(borg.stdin) |
|
|
|
borg.stdin.close() |
|
|
|
ret = borg.wait() |
|
|
|
try: |
|
|
|
# Give borg some time to start, just to clean up stdout |
|
|
|
time.sleep(2) |
|
|
|
backup.run(borg.stdin) |
|
|
|
except BrokenPipeError: |
|
|
|
sys.stderr.write(f"broken pipe\n") |
|
|
|
finally: |
|
|
|
try: |
|
|
|
borg.stdin.close() |
|
|
|
except BrokenPipeError: |
|
|
|
pass |
|
|
|
borg.wait() |
|
|
|
ret = borg.returncode |
|
|
|
if ret < 0: |
|
|
|
sys.stderr.write(f"error: process exited with signal {-ret}\n") |
|
|
|
return 1 |
|
|
|