Rsync will compare a source and a target folder and synchronize them. The folders aren't necessarily on the same computer of course.
The goal is to run the command quickly as well as use minimal bandwidth.
All in one row. Parameter explanations below.
# rsync --archive -vv --rsh=ssh --compress --sparse --stats --progress --ignore-existing server1.domain.com:/foo/ /bar
Note: No slash after /bar.
Why? See sources below.
In short; the contents of server1.domain.com:/foo/ should be synced to the folder /bar, not to /bar/foo.
The same as using
--links (recreate sym)
--owner destination owner = source owner
--group ditto group
--devices transfer char and block devices
--times transfer modification times
Be very verbose about what it's doing.
This option allows you to choose an alternative remote shell program to use for communication between the local and remote copies of rsync. Typically, rsync is configured to use ssh by default, but you may prefer to use rsh on a local network.
Use file compression while transferrring.
Efficiently handle sparse files.
A sparse file is a type of computer file that attempts to use file system space more efficiently, when the file itself is partially empty.
See what the command is doing and how long it's been running. Usable when a big job is running.
Will leave already existing files in the destination folder as is.