The command rsync -avzu
uses rsync
, a fast and versatile file synchronization tool. Let’s break down what each option means and an example:
rsync -avzu root@hostname.com:/home/site/public_html/ /usr/share/nginx/sites/site.com/
Flags:
-a
(archive mode):- Preserves symbolic links, file permissions, modification times, group/owner information, and recursive directory traversal.
- Essentially, it ensures that the copied files retain their original state as much as possible.
-v
(verbose):- Displays detailed output about what
rsync
is doing during the transfer. Useful for tracking the progress and files being synced.
- Displays detailed output about what
-z
(compress):- Compresses the data during the transfer to minimize network bandwidth usage, speeding up the process over slow connections.
-u
(update):- Ensures that only newer files are copied. If the destination has a newer or same timestamp file, it will be skipped, avoiding unnecessary overwrites.