Catalog / Rsync Cheatsheet
Rsync Cheatsheet
A comprehensive cheat sheet covering essential Rsync commands, options, and use cases for efficient file synchronization and backup.
Basic Usage
Core Syntax
|
Local: Remote: |
Basic Examples
Syncing a local folder to another local folder: |
Syncing a local folder to a remote folder (push): |
Syncing a remote folder to a local folder (pull): |
Syncing the contents of a source directory: |
Important Notes
Trailing slash |
|
Essential Options
Transfer Options
|
Enable compression during transfer to reduce bandwidth usage. |
|
Allows resuming of aborted syncs, useful for large files or unreliable connections. |
|
Limits socket I/O bandwidth to a specified RATE in KB/s. Example: |
|
Tells rsync to execute from a specific path, useful if rsync isn’t in the system’s default path. |
Display Options
|
Suppress non-error messages. |
|
Increase verbosity. Use |
|
Show file transfer stats. |
|
Output numbers in a human-readable format. |
|
Show progress during transfer. |
|
Equivalent to |
Advanced Options
Skipping and Filtering
|
Skip files that are newer on the destination. |
|
Skip files based on checksum, not modification time and size. |
|
Exclude files matching the specified pattern. |
|
Include files matching the specified pattern (overrides exclude). |
|
Read exclude patterns from FILE. |
|
Read include patterns from FILE. |
|
Read list of filenames from FILE to transfer. |
|
Exclude files that would be excluded by CVS (from local/global |
Deletion Options
|
Delete extraneous files from the destination directory. Use with caution! |
|
Deletion happens before transfer. |
|
Deletion happens after transfer. This is the default. |
|
Deletion happens during transfer (less efficient). |
|
Find deletions during, defer until after. |
Backup Options
|
Backup with suffix. |
|
Backup suffix (default |
|
Make backups into hierarchy under DIR. |
|
Hardlink to files in DIR when unchanged. |
Archive and Security
Archive Options
|
Archive mode; equals |
|
Recurse into directories. |
|
Copy symlinks as links. |
|
Preserve permissions. |
|
Preserve modification times. |
|
Preserve group. |
|
Preserve owner (super-user only). |
|
Preserve devices and special files. |
Security Options
|
Don’t map uid/gid values by user/group name. |
|
Don’t send implied directories with |
|
Store/recover privileged attrs using a fake super account. |
OSX Specific Exclusions
Common exclusions for macOS systems: |