8 examples for rsync

{{ score }}
  # Makes the remote folder look *exactly* like the source dir including file
# permissions, ownership, etc.
# -a Archive (sets a number of things).
# -v Versose
# --delete Dangerous!  Will remove files on the remote which do not exist
#          in source.
# Be sure you have remotedir set properly and maybe run without --delete
# once to ensure that it does what you think it will do.
rsync -av --progress --delete sourcedir user@host:remotedir
{{ score }}
  # Sync 2 folders/destinations recursively, overwrite, update, verbosely
rsync -ruv ~/source/dir ~/destination/dir
{{ score }}
  # Download a remote file from an ssh-compatable server.
# Reverse the arguments to upload.

rsync -vP user@my_server:remote_dir/remote_file local_dir/local_filename

# -v gives a bit more information
# -P shows progress and allows transfer to be resumed with the same
#    command after killing rsync
{{ score }}
  # Remotely SYNC two directories, smarter than scp and easier than creating a tar

rsync -rtvP --bwlimit=65 [source] [destination] 

# Where
# -r is recursive
# -t retains the files' modification time
# -v to show what is going on
# -P shows the progress
# --bwlimit=65 limits the upload to 65Kb/sec
{{ score }}
  # ssh on a different port, with progress
rsync -P -rsh='ssh -p9001' user@remote.box:source.file destination.file
{{ score }}
  # Rsync to different port
rsync -e "ssh -p 9999" /path/to/local_file domain.com:/path/to/remote_file
{{ score }}
  # transfer a local file to a remote-server, with progress
rsync --progress localFile.txt remote-server:/targetDirectory
{{ score }}
  # Upload file from you local to your server.
rsync -avzP ./local_website_folder/ user@example.com:/var/www/html/