You are on page 1of 3

rsync Cheat Sheet

by Richard Holloway (richardjh) via cheatography.com/478/cs/329/

rsync Usage rsync Options (cont) rsync Options (cont)

rsync [OPTION]... SRC [SRC]... DEST -- make backups into hierarchy --acls, -A preserve ACLs (implies --

rsync [OPTION]... SRC [SRC]... backup-dir= based in DIR perms)


DIR
[USER@]HOST:DEST --xattrs, -X preserve extended attributes

rsync [OPTION]... SRC [SRC]... -- set backup suffix (default ~ w/o --owner, -o preserve owner (super-user
suffix=SUF --backup-dir)
[USER@]HOST::DEST only)
FIX
rsync [OPTION]... SRC [SRC]... --group, -g preserve group
--update, -u skip files that are newer on the
rsync://[USER@]HOST[:PORT]/DEST
--devices preserve device files (super-
receiver
rsync [OPTION]... [USER@]HOST:SRC [DEST] user only)
--inplace update destination files in-place
rsync [OPTION]... [USER@]HOST::SRC --specials preserve special files
(SEE MAN PAGE
[DEST]
-D same as --devices --special
--append append data onto shorter files
rsync [OPTION]...
--times, -t preserve modification times
-- like --append, but with old data
rsync://[USER@]HOST[:PORT]/SRC [DEST]
append-verif in file checksum --omit-dir- omit directories from --times
The ':' usages connect via remote shell, while '::' y times, -O
& 'rsync://' usages connect to an rsync daemon,
--dirs, -d transfer directories without --super receiver attempts super-user
and require SRC or DEST to start with a
recursing activities
module name.
--links, -l copy symlinks as symlinks --fake-super store/recover privileged attrs
using xattrs
rsync Options --copy- transform symlink into referent
links, -L file/dir
-- increase verbosity rsync Options contd.
verbose, --copy- only "unsafe" symlinks are

-v unsafe-links transformed --sparse, -S handle sparse files efficiently

--quiet, -q suppress non-error messages --safe-links ignore symlinks that point --dry-run, -n perform a trial run with no
outside the source tree changes made
--no- suppress daemon-mode MOTD
motd (see manpage caveat) --copy- transform symlink to a dir into --whole-file, - copy files whole (without delta-
dirlinks, -k referent dir W xfer algorithm)
-- skip based on checksum, not mod-
checksum time & size --keep- treat symlinked dir on receiver --one-file- don't cross filesystem
, -c dirlinks, -K as dir system, -x boundaries

--archive, archive mode; equals -rlptgoD (no --hard-links, preserve hard links --block- force a fixed checksum block-

-a -H,-A,-X) -H size=SIZE size

--no- turn off an implied OPTION (e.g. -- --perms, -p preserve permissions -- specify the remote shell to use

OPTION no-D) rsh=COMMA


-- preserve the file's executability
ND, -e
-- recurse into directories executability

recursive, , -E
-r -- affect file and/or directory

-- use relative path names chmod=CH permissions

relative, - MOD

--no- don't send implied dirs with --


implied- relative
dirs

--backup, make backups (see --suffix & --


-b backup-dir)

By Richard Holloway (richardjh) Published 27th March, 2012. Sponsored by Readability-Score.com


cheatography.com/richardjh/ Last updated 5th June, 2014. Measure your website readability!
richardjh.org Page 1 of 3. https://readability-score.com
rsync Cheat Sheet
by Richard Holloway (richardjh) via cheatography.com/478/cs/329/

rsync Options contd. (cont) rsync Options contd. (cont) rsync Options cont'd.

--rsync- specify the rsync to run on --partial keep partially transferred files --compress- explicitly set compression
path=PROGRA the remote machine --partial- put a partially transferred file level=NUM level
M
dir=DIR into DIR --skip- skip compressing files with a
--existing skip creating new files on compress=LIS suffix in LIST
--delay- put all updated files into place
receiver T
updates at transfer's end
-- skip updating files that --cvs-exclude, auto-ignore files the same
--prune- prune empty directory chains
ignore-existing already exist on receiver -C way CVS does
empty-dirs, -m from the file-list
-- sender removes --filter=RULE, add a file-filtering RULE
--numeric-ids don't map uid/gid values by
remove-source synchronized files (non-dirs) user/group name -f
-files -F same as --filter='dir-merge
-- set I/O timeout in seconds
--del an alias for --delete-during /.rsync-filter'
timeout=SEC
--delete delete extraneous files from ONDS repeated: --filter='- .rsync-
destination dirs --contimeout set daemon connection filter'

-- receiver deletes before timeout in seconds -- exclude files matching


delete-before transfer, not during -- don't skip files that match in exclude=PATT PATTERN

-- receiver deletes during ignore-times, - size and mod-time ERN

delete-during transfer (default) I --exclude- read exclude patterns from


from=FILE FILE
--delete-delay find deletions during, delete --size-only skip files that match in size
after -- don't exclude files matching
-- compare mod-times with
include=PATT PATTERN
--delete-after receiver deletes after transfer, modify-windo reduced accuracy
ERN
not during w=NUM

-- also delete excluded files --temp-dir, -T create temporary files in --include- read include patterns from

delete-excluded from destination dirs directory DIR from=FILE FILE

-- delete even if there are I/O --fuzzy, -y find similar file for basis if no --files- read list of source-file names

ignore-errors errors dest file from=FILE from FILE

--force force deletion of directories --compare- also compare destination files --from0, -0 all *-from/filter files are

even if not empty dest=DIR relative to DIR delimited by 0s

--protect-args, no space-splitting; only


-- don't delete more than NUM --copy- ... and include copies of
-s wildcard special-chars
max-delete=N files dest=DIR unchanged files
UM --link- hardlink to files in DIR when -- bind address for outgoing
address=ADD socket to daemon
-- don't transfer any file larger dest=DIR unchanged
RESS
max-size=SIZE than SIZE --compress, - compress file data during the
-- don't transfer any file smaller z transfer --port=PORT specify double-colon

min-size=SIZE than SIZE alternate port number

-- specify custom TCP options


sockopts=OPTI
ONS

By Richard Holloway (richardjh) Published 27th March, 2012. Sponsored by Readability-Score.com


cheatography.com/richardjh/ Last updated 5th June, 2014. Measure your website readability!
richardjh.org Page 2 of 3. https://readability-score.com
rsync Cheat Sheet
by Richard Holloway (richardjh) via cheatography.com/478/cs/329/

rsync Options cont'd. (cont) rsync Options cont'd. (cont)

--blocking-io use blocking I/O for the -- force an older protocol


remote shell protocol=NUM version to be used

--stats give some file-transfer stats -- request charset conversion

--8-bit-output, - leave high-bit chars iconv=CONVE of filenames

8 unescaped in output RT_SPEC

--human- output numbers in a --ipv4, -4 prefer IPv4

readble, -h human-readable format --ipv6, -6 prefer IPv6

--progress show progress during transfer --version print version number

-P same as --partial --progress --help, -h show this help ( -h works

--itemize- output a change-summary for with no other options )

changes, -i all updates Please see the rsync(1) and rsyncd.conf(5)


-- output a change-summary for man pages for full documentation.
out-format=FO all updates See http://rsync.samba.org/ for updates, bug
RMAT reports, and answers

--log-file=FILE log what we're doing to the


specified FILE

--log-file- log updates using the


format=FMT specified FMT

--password- read daemon-access


file=FILE password from FILE

--list-only list the files instead of


copying them

-- limit I/O bandwidth; KBytes


bwlimit=KBPS per second

--write- write a batched update to


batch=FILE FILE

--only-write- like --write-batch but w/o


batch=FILE updating destination

--read- read a batched update from


batch=FILE FILE

By Richard Holloway (richardjh) Published 27th March, 2012. Sponsored by Readability-Score.com


cheatography.com/richardjh/ Last updated 5th June, 2014. Measure your website readability!
richardjh.org Page 3 of 3. https://readability-score.com

You might also like