From ed86e78fc9faa81cdc606b67419ae625789d17a8 Mon Sep 17 00:00:00 2001 From: Tim Sherratt Date: Wed, 17 Jan 2024 10:11:09 +1100 Subject: [PATCH] Add space to SSH command to fix error when using -i option (#46) * Add space to SSH command to fix error when using -i option Using the `-i` option to supply a SSH key fails with the error 'Safety check failed - the destination does not appear to be a backup folder or drive (marker file not found).' This seems to be because of a missing space in the SSH parsing code which means that the key address and the SSH address get munged together. This pull request simply adds a space between them. * add space elsewhere to make test pass * oops --------- Co-authored-by: Bas Nijholt --- rsync_time_machine.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rsync_time_machine.py b/rsync_time_machine.py index b441c88..4ff283f 100755 --- a/rsync_time_machine.py +++ b/rsync_time_machine.py @@ -220,7 +220,8 @@ def parse_ssh( ssh_user = ssh["user"] if ssh["user"] else "" ssh_host = ssh["host"] auth = f"{ssh_user}@{ssh_host}" if ssh_user else ssh_host - ssh_cmd = f"ssh -p {ssh_port} {'-i ' + id_rsa if id_rsa else ''}{auth}" + id_rsa_opt = f"-i {id_rsa} " if id_rsa else "" + ssh_cmd = f"ssh -p {ssh_port} {id_rsa_opt}{auth}" ssh_src_folder_prefix = f"{auth}:" if ssh_src else "" ssh_dest_folder_prefix = f"{auth}:" if ssh_dest else ""