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

rsync [OPTION]... SRC [SRC]...

backup-dir=

based in DIR

[USER@]HOST:DEST

DIR

rsync [OPTION]... SRC [SRC]...

--

set backup suffix (default ~ w/o

suffix=SUF

--backup-dir)

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

FIX
--update, -u

skip files that are newer on the


receiver

--inplace

update destination files in-place


(SEE MAN PAGE

--append

append data onto shorter files

rsync://[USER@]HOST[:PORT]/SRC [DEST]

--

like --append, but with old data

append-verif

in file checksum

The ':' usages connect via remote shell, while '::'

rsync [OPTION]...

& 'rsync://' usages connect to an rsync daemon,


and require SRC or DEST to start with a

--dirs, -d

perms)
--xattrs, -X

preserve extended attributes

--owner, -o

preserve owner (super-user


only)

--group, -g

preserve group

--devices

preserve device files (superuser only)

--specials

preserve special files

-D

same as --devices --special

--times, -t

preserve modification times

--omit-dir-

omit directories from --times

times, -O
transfer directories without

--super

receiver attempts super-user


activities

recursing

module name.

preserve ACLs (implies --

--fake-super

store/recover privileged attrs

--links, -l

copy symlinks as symlinks

--copy-

transform symlink into referent

links, -L

file/dir

verbose,

--copy-

only "unsafe" symlinks are

-v

unsafe-links

transformed

--sparse, -S

handle sparse files efficiently

--safe-links

ignore symlinks that point

--dry-run, -n

perform a trial run with no

rsync Options
--

--quiet, -q

increase verbosity

suppress non-error messages

--no-

suppress daemon-mode MOTD

motd

(see manpage caveat)

--

skip based on checksum, not mod-

checksum

time & size

, -c

transform symlink to a dir into

--whole-file, -

copy files whole (without delta-

dirlinks, -k

referent dir

xfer algorithm)

--keep-

treat symlinked dir on receiver

--one-file-

don't cross filesystem

dirlinks, -K

as dir

system, -x

boundaries

preserve hard links

--block-

force a fixed checksum block-

size=SIZE

size

--

specify the remote shell to use

archive mode; equals -rlptgoD (no

--hard-links,

-H,-A,-X)

-H

--no-

turn off an implied OPTION (e.g. --

--perms, -p

no-D)

--

recurse into directories

executability

preserve permissions
preserve the file's executability

recursive,

, -E

-r

--

affect file and/or directory

--

chmod=CH

permissions

use relative path names

changes made

--copy-

-a

--

rsync Options contd.

outside the source tree

--archive,

OPTION

using xattrs

rsh=COMMA
ND, -e

MOD

relative, R
--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

dir=DIR

into DIR

--skip-

skip compressing files with a

compress=LIS

suffix in LIST

M
--existing

skip creating new files on


receiver

--

skip updating files that

ignore-existing

already exist on receiver

--

sender removes

remove-source

synchronized files (non-dirs)

-files

--delay-

put all updated files into place

updates

at transfer's end

--prune-

prune empty directory chains

empty-dirs, -m

from the file-list

--numeric-ids

don't map uid/gid values by


user/group name

--

--del

an alias for --delete-during

--delete

delete extraneous files from

ONDS

destination dirs

--contimeout

--

receiver deletes before

delete-before

transfer, not during

-C

way CVS does

--filter=RULE,

add a file-filtering RULE

-f
-F

same as --filter='dir-merge
/.rsync-filter'
repeated: --filter='- .rsyncfilter'

set daemon connection


--

exclude files matching

--

don't skip files that match in

exclude=PATT

PATTERN

size and mod-time

ignore-times, -

delete-during

transfer (default)

--

auto-ignore files the same

timeout in seconds

receiver deletes during

--delete-after

--cvs-exclude,

timeout=SEC

--

--delete-delay

set I/O timeout in seconds

ERN
--exclude-

read exclude patterns from

from=FILE

FILE

--

don't exclude files matching


PATTERN

find deletions during, delete

--size-only

skip files that match in size

after

--

compare mod-times with

receiver deletes after transfer,

modify-windo

reduced accuracy

include=PATT

not during

w=NUM

also delete excluded files

--temp-dir, -T

create temporary files in

--include-

read include patterns from

from=FILE

FILE

--files-

read list of source-file names

dest file

from=FILE

from FILE

--from0, -0

all *-from/filter files are

delete-excluded from destination dirs

directory DIR

--

delete even if there are I/O

ignore-errors

errors

--force

force deletion of directories

--compare-

also compare destination files

even if not empty

dest=DIR

relative to DIR

--

don't delete more than NUM

--copy-

... and include copies of

max-delete=N

files

dest=DIR

UM
--

don't transfer any file larger

max-size=SIZE

than SIZE

--

don't transfer any file smaller

min-size=SIZE

than SIZE

--fuzzy, -y

find similar file for basis if no

ERN

delimited by 0s
--protect-args,

no space-splitting; only

unchanged files

-s

wildcard special-chars

--link-

hardlink to files in DIR when

--

bind address for outgoing

dest=DIR

unchanged

address=ADD

socket to daemon

--compress, -

compress file data during the

transfer

RESS
--port=PORT

specify double-colon
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

give some file-transfer stats

--

request charset conversion

iconv=CONVE

of filenames

--stats
--8-bit-output, -

leave high-bit chars

unescaped in output

--human-

output numbers in a

readble, -h

RT_SPEC
--ipv4, -4

prefer IPv4

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

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


reports, and answers

RMAT
--log-file=FILE

with no other options )

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