Skip to content

Instantly share code, notes, and snippets.

@algotrader-dotcom
Last active September 13, 2016 06:54
Show Gist options
  • Select an option

  • Save algotrader-dotcom/6b05df9bce361ce66013 to your computer and use it in GitHub Desktop.

Select an option

Save algotrader-dotcom/6b05df9bce361ce66013 to your computer and use it in GitHub Desktop.
rsync with ssh key
## This will sync directory from remote machine to local
sudo rsync -arvz -e "ssh -i your-key.pem" ec2-user@ip-address:/path/to/dir/ temp/
## scp with key
scp -i mykey.pem somefile.txt root@my.ec2.id.amazonaws.com:/
## This will sync from local to remote
sudo rsync -arvz -e "ssh -i your-key.pem" temp/ ec2-user@ip-address:/path/to/dir/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment