create target backup directory when needed
This commit is contained in:
1 parent
98240ee288
commit
d53b156d27
1 file changed
+5
@@ -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:
|
||||
|
||||
Reference in new issue
Block a user