create target backup directory when needed

This commit is contained in:
DIL5 committed 2026-11-04 15:57:02 +01:00
1 parent 98240ee288
commit d53b156d27
1 file changed
+5
+5
View File
@@ -61,6 +61,10 @@ def backup() -> bool:
return subprocess.run(cmd, cwd=HOME).returncode == 0
def make_target_dir():
return subprocess.run(['ssh', CENTRAL, 'mkdir', '-p', REMOTE_DIR]).returncode == 0
def restore() -> bool:
# "/./" marks where the relative path starts, so with -R each subtree
# lands under $HOME with its original relative path
@@ -110,6 +114,7 @@ def cmd_backup() -> None:
cwd=HOME, stdout=subprocess.PIPE, text=True,
)
threading.Thread(target=reader, args=(watcher,), daemon=True).start()
make_target_dir()
try:
while True:
if watcher.poll() is not None: