I can ssh into my EC2 with:
ssh -i /Users/User/Downloads/key.pem [email protected]
My directory:
/A
/B
/folderToTransfer
I can rsync into the same directory with:
rsync -avrz -e “ssh -i /Users/User/Downloads/key.pem” /
/Users/User/Documents/Programming/A/B/folderToTransfer /
[email protected]
New directory:
/A
/B
/folderToTransfer
/[email protected]
But this fails (when adding :~/ to the end)
rsync -avrz -e “ssh -i /Users/User/Downloads/key.pem” /
/Users/User/Documents/Programming/A/B/folderToTransfer /
[email protected]:~/
With the error
rsync: Failed to exec ?\#200\#234ssh: No such file or directory (2)
rsync error: error in IPC code (code 14) at /BuildRoot/Library/Caches/com.apple.xbs/Sources/rsync/rsync-47/rsync/pipe.c(86) [sender=2.6.9]
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at /BuildRoot/Library/Caches/com.apple.xbs/Sources/rsync/rsync-47/rsync/io.c(453) [sender=2.6.9]
Others don't seem to have this same problem when rsyncing with ssh -i, what have I done wrong?
rsync -avrz -e “ssh -i /Users/User/Downloads/key.pem” /
^ ^
You're not using the ASCII double quote character " here. You're using some kind of open- and close-quote characters intended for typesetting. Your command is failing because the shell doesn't treat these characters as quote marks; rsync ends up trying to execute a program named “ssh.
Replace the characters with ASCII double quotes:
rsync -avrz -e "ssh -i /Users/User/Downloads/key.pem" /
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With