Synchronizing files with servers with SSH keys - Transfer files between servers

added on :: 6 October 2014

rsync -rave "ssh -i /User/hellome/myssh_key/thesshkey.pem" /Users/antmac/raislapps/iamfree/public/assets --rsync-path="sudo rsync" ssh -i ssh -i thesshkey.pem ec2-user@

firstly the command

then the path to the ssh key

Path to the file or directory you are transfering (path to the origination)

then rsync path

then the server user@server ip

then the destination path.

This can be used to build the Ruby on Rails asset pipeline assets locally and sync with the server.

See the above code does the sudo rsync.