0

I want to rync my folders which are in amazon instance to my linux pc on network. I tried following but it gives me error as I know that I have done some syntax mistake..

rsync -avPn "ssh -i /keys/mykey.pem ec2-user@X.X.X.X:/data/" /data/

Pls help me to improve my comand.

Error:

sending incremental file list
rsync: change_dir "/root//ssh -i /keys/mykey.pem ec2-user@x.x.x.x:/data/" failed: No such file or directory (2)

sent 12 bytes  received 12 bytes  48.00 bytes/sec
total size is 0  speedup is 0.00 (DRY RUN)
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1072) [sender=3.0.9]
KK Patel
  • 153
  • 5
  • 14

1 Answers1

0

You could set up your ssh-agent to store SSH Keys and then add mykey.pem to your SSH agent before using rsync. Further, you could simply use the syntax:

rsync -avPn ec2-user@X.X.X.X:/data/ /data/

This SO question here talks about a similar problem. Hope this helps.

P.S.: It would be great if you could support your question with error message(s) if any, that would help everyone identify the exact problem and provide efficient solutions.

Community
  • 1
  • 1
rhetonik
  • 1,818
  • 1
  • 15
  • 21