rsync -arvzh [host:]/source/path/ [host:]/destination/path
Note the trailing slash in source path: this avoids creating [host:]/destination/path/path.
-a: archive (i.e. ensures that symlinks, attributes, permissions, owner, etc. are preserved)-r: recursive-v: verbose (secondvgives what files are being skipped and some stats at the end)-z: compress-h: human-readable format of numbers
-
--del | --delete: delete files on the destination that are not sent from the source -
--stats: file-transfer statistics at the end -
-m: prune empty directories from file-list -
-t: preserve modification times
This is how I deploy changes of this site with rsync:
rsync -arvzh --delete public/ vld.bg:www/vld.bg/public_html/