Cheat sheets for Rsync

Cheat sheets for Rsync

#General

rsync Usage

rsync \[OPTION\]... SRC \[SRC\]... DEST
rsync \[OPTION\]... SRC \[SRC\]... \[USER@\]HOST:DEST
rsync \[OPTION\]... SRC \[SRC\]... \[USER@\]HOST::DEST
rsync \[OPTION\]... SRC \[SRC\]... rsync://\[USER@\]HOST\[:PORT\]/DEST
rsync \[OPTION\]... \[USER@\]HOST:SRC \[DEST\]
rsync \[OPTION\]... \[USER@\]HOST::SRC \[DEST\]
rsync \[OPTION\]... rsync://\[USER@\]HOST\[:PORT\]/SRC \[DEST\]

The ':' usages connect via remote shell, while '::' & 'rsync://' usages connect to an rsync daemon, and require SRC or DEST to start with a module name.

rsync Options

OptionDescription
--verbose, -vincrease verbosity
--quiet, -qsuppress non-error messages
--nomotdsuppress daemon-mode MOTD (see manpage caveat)
--checksum, -cskip based on checksum, not mod-time & size
--archive, -aarchive mode; equals -rlptgoD (no -H,-A,-X)
--no-OPTIONturn off an implied OPTION (e.g. --no-D)
--recursive, -rrecurse into directories
--relative, -Ruse relative path names
--no-implied-dirsdon't send implied dirs with --relative
--backup, -bmake backups (see --suffix & --backup-dir)
--backup-dir=DIRmake backups into hierarchy based in DIR
--suffix=SUFFIXset backup suffix (default ~ w/o --backup-dir)
--update, -uskip files that are newer on the receiver
--inplaceupdate destination files in-place (SEE MAN PAGE)
--appendappend data onto shorter files
--append-verifylike --append, but with old data in file checksum
--dirs, -dtransfer directories without recursing
--links, -lcopy symlinks as symlinks
--copy-links, -Ltransform symlink into referent file/dir
--copy-unsafe-linksonly "unsafe" symlinks are transformed
--safe-linksignore symlinks that point outside the source tree
--copy-dirlinks, -ktransform symlink to a dir into referent dir
--keep-dirlinks, -Ktreat symlinked dir on receiver as dir
--hard-links, -Hpreserve hard links
--perms, -ppreserve permissions
--executability, -Epreserve the file's executability
--chmod=CHMODaffect file and/or directory permissions
--acls, -Apreserve ACLs (implies --perms)
--xattrs, -Xpreserve extended attributes
--owner, -opreserve owner (super-user only)
--group, -gpreserve group
--devicespreserve device files (super-user only)
--specialspreserve special files
-Dsame as --devices --special
--times, -tpreserve modification times
--omit-dir-times, -Oomit directories from --times
--superreceiver attempts super-user activities
--fake-superstore/recover privileged attrs using xattrs

rsync Options contd.

OptionDescription
--sparse, -Shandle sparse files efficiently
--dry-run, -nperform a trial run with no changes made
--whole-file, -Wcopy files whole (without delta-xfer algorithm)
--one-file-system, -xdon't cross filesystem boundaries
--block-size=SIZEforce a fixed checksum block-size
--rsh=COMMAND, -especify the remote shell to use
--rsync-path=PROGRAMspecify the rsync to run on the remote machine
--existingskip creating new files on receiver
--ignore-existingskip updating files that already exist on receiver
--remove-source-filessender removes synchronized files (non-dirs)
--delan alias for --delete-during
--deletedelete extraneous files from destination dirs
--delete-beforereceiver deletes before transfer, not during
--delete-duringreceiver deletes during transfer (default)
--delete-delayfind deletions during, delete after
--delete-afterreceiver deletes after transfer, not during
--delete-excludedalso delete excluded files from destination dirs
--ignore-errorsdelete even if there are I/O errors
--forceforce deletion of directories even if not empty
--max-delete=NUMdon't delete more than NUM files
--max-size=SIZEdon't transfer any file larger than SIZE
--min-size=SIZEdon't transfer any file smaller than SIZE
--partialkeep partially transferred files
--partial-dir=DIRput a partially transferred file into DIR
--delay-updatesput all updated files into place at transfer's end
--prune-empty-dirs, -mprune empty directory chains from the file-list
--numeric-idsdon't map uid/gid values by user/group name
--timeout=SECONDSset I/O timeout in seconds
--contimeoutset daemon connection timeout in seconds
--ignore-times, -Idon't skip files that match in size and mod-time
--size-onlyskip files that match in size
--modify-window=NUMcompare mod-times with reduced accuracy
--temp-dir, -Tcreate temporary files in directory DIR
--fuzzy, -yfind similar file for basis if no dest file
--compare-dest=DIRalso compare destination files relative to DIR
--copy-dest=DIR... and include copies of unchanged files
--link-dest=DIRhardlink to files in DIR when unchanged
--compress, -zcompress file data during the transfer

rsync Options cont'd.

OptionDescription
--compress-level=NUMexplicitly set compression level
--skip-compress=LISTskip compressing files with a suffix in LIST
--cvs-exclude, -Cauto-ignore files the same way CVS does
--filter=RULE, -fadd a file-filtering RULE
-Fsame as --filter='dir-merge /.rsync-filter'
repeated: --filter='- .rsync-filter'
--exclude=PATTERNexclude files matching PATTERN
--exclude-from=FILEread exclude patterns from FILE
--include=PATTERNdon't exclude files matching PATTERN
--include-from=FILEread include patterns from FILE
--files-from=FILEread list of source-file names from FILE
--from0, -0all *-from/filter files are delimited by 0s
--protect-args, -sno space-splitting; only wildcard special-chars
--address=ADDRESSbind address for outgoing socket to daemon
--port=PORTspecify double-colon alternate port number
--sockopts=OPTIONSspecify custom TCP options
--blocking-iouse blocking I/O for the remote shell
--statsgive some file-transfer stats
--8-bit-output, -8leave high-bit chars unescaped in output
--human-readble, -houtput numbers in a human-readable format
--progressshow progress during transfer
-Psame as --partial --progress
--itemize-changes, -ioutput a change-summary for all updates
--out-format=FORMAToutput a change-summary for all updates
--log-file=FILElog what we're doing to the specified FILE
--log-file-format=FMTlog updates using the specified FMT
--password-file=FILEread daemon-access password from FILE
--list-onlylist the files instead of copying them
--bwlimit=KBPSlimit I/O bandwidth; KBytes per second
--write-batch=FILEwrite a batched update to FILE
--only-write-batch=FILElike --write-batch but w/o updating destination
--read-batch=FILEread a batched update from FILE
--protocol=NUMforce an older protocol version to be used
--iconv=CONVERT_SPECrequest charset conversion of filenames
--ipv4, -4prefer IPv4
--ipv6, -6prefer IPv6
--versionprint version number
--help, -hshow this help ( -h works with no other options )

Please see the rsync(1) and rsyncd.conf(5) man pages for full documentation.
See http://rsync.samba.org/ for updates, bug reports, and answers

Loading...