Skip to content

Commit

Permalink
Add space to SSH command to fix error when using -i option (#46)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
wragge and basnijholt authored Jan 16, 2024
1 parent 248de06 commit ed86e78
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion rsync_time_machine.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 ""
Expand Down

0 comments on commit ed86e78

Please sign in to comment.