Console9

Rsync flags and options reference

Complete reference table for Rsync command-line flags, options, and their defaults with working examples for file transfer and synchronization.

Complete reference for Rsync command-line flags and options.

Rsync General Output Options

Rsync provides flags to control the verbosity and format of transfer output.

FlagDescriptionDefaultExample
-v, --verboseVerbose output: displays file names transferred and a summary at the end. Multiple -v flags increase verbosity.offrsync -v src/ dest/
-q, --quietSuppresses non-error messages. Rsync produces no output except errors when this flag is set. Useful for cron jobs.offrsync -aq src/ dest/
-h, --human-readableDisplays file sizes in human-readable units (KB, MB, GB) instead of raw bytes.offrsync -avh src/ dest/
--progressShows a progress bar for each file during the transfer. Rsync displays bytes transferred, percentage complete, and transfer speed.offrsync -av --progress src/ dest/
--statsPrints detailed file-transfer statistics at the end of the transfer, including total bytes sent, received, and the speedup ratio.offrsync -av --stats src/ dest/
--info=FLAGSFine-grained control over Rsync's informational output. Accepts comma-separated flags such as progress2, name, and stats.nonersync -av --info=progress2 src/ dest/
--log-file=FILEWrites Rsync's output to a log file at the specified path.nonersync -av --log-file=/var/log/rsync.log src/ dest/

Rsync Archive and Recursion Options

Rsync uses archive and recursion flags to control directory traversal and metadata preservation.

FlagDescriptionDefaultExample
-a, --archiveArchive mode: preserves file permissions, timestamps, symbolic links, group ownership, owner, and device files during transfer. Equivalent to -rlptgoD. The recommended default for most transfers.offrsync -a src/ dest/
-r, --recursiveRecursively copies directories and their contents. Included in -a. Does not preserve permissions, timestamps, or ownership on its own.offrsync -r src/ dest/
-l, --linksCopies symbolic links as symbolic links. Included in -a.offrsync -rl src/ dest/
-p, --permsPreserves file permissions on the destination. Included in -a.offrsync -rp src/ dest/
-t, --timesPreserves modification times on the destination. Included in -a. Rsync uses modification times to detect changed files.offrsync -rt src/ dest/
-g, --groupPreserves group ownership on the destination. Included in -a.offrsync -rg src/ dest/
-o, --ownerPreserves file owner on the destination. Included in -a. Requires root privileges on the destination.offrsync -ro src/ dest/
-DPreserves device files and special files. Included in -a. Equivalent to --devices --specials.offrsync -rD src/ dest/

Rsync Transfer Behavior Options

Rsync flags that control how files are compared, compressed, and transferred.

FlagDescriptionDefaultExample
-z, --compressCompresses file data during the transfer to reduce bandwidth usage. Rsync decompresses data at the destination.offrsync -avz src/ dest/
-n, --dry-runDry run: simulates the transfer and shows what Rsync would do without writing any files to disk.offrsync -avn src/ dest/
-PCombines --partial and --progress. Keeps partially transferred files and shows a per-file progress bar.offrsync -avP src/ dest/
--partialKeeps partially transferred files on the destination. Rsync resumes from the partial file on the next run instead of re-transferring from scratch.offrsync -av --partial src/ dest/
-u, --updateSkips files that are newer on the destination than on the source. Rsync compares modification times.offrsync -avu src/ dest/
-c, --checksumCompares files by checksum (MD5 or xxHash) instead of modification time and file size. Slower but more accurate.offrsync -avc src/ dest/
-I, --ignore-timesForces Rsync to transfer all files regardless of whether modification time and size match. Disables the quick-check optimization.offrsync -avI src/ dest/
--size-onlySkips files only when their sizes match, ignoring modification times. Useful when timestamps are unreliable, such as on FAT32 filesystems.offrsync -av --size-only src/ dest/
-W, --whole-fileDisables Rsync's delta-transfer algorithm and copies entire files. Faster for local transfers where disk I/O is faster than checksum computation.autorsync -avW src/ dest/
--bwlimit=RATELimits the transfer bandwidth in kilobytes per second. Rsync throttles its transfer speed to stay below this limit.unlimitedrsync -avz --bwlimit=1000 src/ dest/
--timeout=SECONDSSets Rsync's I/O timeout in seconds. Rsync exits if no data is transferred within this period. Set to 0 to disable.0 (none)rsync -avz --timeout=300 src/ dest/

Rsync Remote Shell Options

Rsync flags for configuring the remote shell transport, including SSH.

FlagDescriptionDefaultExample
-e, --rsh=COMMANDSpecifies the remote shell program. Rsync uses SSH by default. Use this flag to pass SSH options such as a non-standard port.sshrsync -avz -e "ssh -p 2222" src/ user@host:dest/
--rsync-path=PROGRAMSpecifies the path to the Rsync binary on the remote machine. Rsync uses this to run a command on the remote side before starting the transfer.rsyncrsync -a --rsync-path="sudo rsync" src/ user@host:dest/

Rsync Delete and Backup Options

Rsync flags for mirroring directories and creating backups of overwritten files.

FlagDescriptionDefaultExample
--deleteDeletes files in the destination that do not exist in the source. Rsync creates an exact mirror of the source directory.offrsync -av --delete src/ dest/
--delete-afterPerforms deletions after the transfer completes, not during. Safer than --delete because files are available throughout the transfer.offrsync -av --delete-after src/ dest/
--remove-source-filesDeletes source files after Rsync transfers them. Effectively moves files instead of copying them.offrsync -av --remove-source-files src/ dest/
-b, --backupCreates backup copies of files that Rsync overwrites at the destination. Backup files receive a tilde ( ~) suffix by default.offrsync -avb src/ dest/
--backup-dir=DIRSpecifies the directory where Rsync stores backup copies of overwritten files.nonersync -avb --backup-dir=/backup/old src/ dest/
--suffix=SUFFIXSets the suffix appended to backup file names. Rsync uses ~ by default.~rsync -avb --suffix=.bak src/ dest/

Rsync Filter and Exclude Options

Rsync flags for including or excluding files and directories from the transfer.

FlagDescriptionDefaultExample
--exclude=PATTERNExcludes files or directories matching the specified pattern from the transfer. Rsync accepts glob patterns.nonersync -av --exclude='*.log' src/ dest/
--include=PATTERNIncludes files matching the specified pattern. Rsync evaluates include rules before exclude rules.nonersync -av --include='*.conf' --exclude='*' src/ dest/
--exclude-from=FILEReads exclude patterns from a file, one pattern per line.nonersync -av --exclude-from=exclude.txt src/ dest/
-f, --filter=RULEAdds a file-filtering rule. Rsync processes filter rules in order.nonersync -av -f '- *.tmp' src/ dest/

Rsync Permission and Timestamp Override Options

Rsync flags for overriding permission and timestamp handling, especially on non-Unix filesystems.

FlagDescriptionDefaultExample
--no-permsSkips setting file permissions on the destination. Rsync applies the destination's default umask instead. Use this flag when syncing to FAT32 or NTFS filesystems that do not support Unix permissions.offrsync -av --no-perms src/ dest/
--no-ownerSkips setting file ownership on the destination. Alias: --no-o.offrsync -av --no-o src/ dest/
--no-groupSkips setting group ownership on the destination. Alias: --no-g.offrsync -av --no-g src/ dest/
-O, --omit-dir-timesSkips setting modification times on directories. Rsync still preserves file timestamps. Use this flag when the destination filesystem or user permissions do not allow setting directory timestamps.offrsync -aO src/ dest/
--chmod=CHMODApplies the specified permission changes to files on the destination. Rsync uses chmod syntax.nonersync -av --chmod=F644,D755 src/ dest/
--modify-window=NUMAllows a timestamp comparison tolerance of NUM seconds. Rsync treats timestamps within this window as equal. Use --modify-window=1 for FAT32 destinations that store timestamps with 2-second precision.0rsync -av --modify-window=1 src/ dest/

Rsync Advanced Options

Rsync flags for incremental backups, hard link preservation, and filesystem boundary control.

FlagDescriptionDefaultExample
--link-dest=DIRCreates hard links to unchanged files in a reference directory instead of copying them. Rsync uses this for space-efficient incremental snapshot backups.nonersync -a --link-dest=/backup/prev src/ /backup/current
-H, --hard-linksPreserves hard links between files during the transfer.offrsync -aH src/ dest/
-A, --aclsPreserves Access Control Lists (ACLs) on the destination.offrsync -aA src/ dest/
-X, --xattrsPreserves extended attributes (xattrs) on the destination.offrsync -aX src/ dest/
--sparseHandles sparse files efficiently by not allocating disk space for zero-filled sections.offrsync -av --sparse src/ dest/
-x, --one-file-systemPrevents Rsync from crossing filesystem boundaries. Rsync stays on the same mounted filesystem as the source.offrsync -avx src/ dest/
--numeric-idsTransfers numeric user and group IDs instead of mapping them by name. Rsync avoids name-to-ID resolution on the destination.offrsync -av --numeric-ids src/ dest/
-i, --itemize-changesOutputs a detailed change summary for each file using a coded string. Rsync shows which attributes changed (permissions, size, timestamp).offrsync -avi src/ dest/
--relativePreserves the full source path on the destination. Rsync creates the same directory structure relative to the source root.offrsync -av --relative /home/user/./docs/ user@host:/backup/