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@256.123.123.12:/var/www/
iamfree
/current/public/
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.