rsync [OPTION] src dest
| Option | Use |
|---|---|
-r |
Synchronises the entire directory recursively |
-l |
Copy symlinks as symlinks |
-p |
Preserves permissions links |
-t |
Preserves time stamps |
-g |
Preserves group ownership |
-o |
Preserves owner |
-D |
Preserves device files |
-n |
Preforms a dry run |
-a |
Uses archive mode, this ensures that all subdirectory structure and file properties are synchronised |
-A |
Uses archive mode and synchronises ACLs |
-X |
Synchronises SELinux context as well |
-H |
Used to preserve hard links |
Trailing slash on the source directory matters. Include it to copy the contents of the directory and not the directory itself. Exclude it to copy the source directory AND the contents.