Sunteți pe pagina 1din 53

1/10/12 rsnc

1/53 www.samba.org/ftp/rsnc/rsnc.html
rsnc
23 Sep 2011
rsnc(1)
23 Sep 2011
NAME
rsync - a Iast, versatile, remote (and local) Iile-copying tool
SYNOPSIS
Local: rsnc [OPTION...] SRC... [DEST]
Access via remote shell:
Pull: rsnc [OPTION...] [USER@]HOST:SRC... [DEST]
Push: rsnc [OPTION...] SRC... [USER@]HOST:DEST
Access via rsnc daemon:
Pull: rsnc [OPTION...] [USER@]HOST::SRC... [DEST]
rsnc [OPTION...] rsnc://[USER@]HOST[:PORT]/SRC... [DEST]
Push: rsnc [OPTION...] SRC... [USER@]HOST::DEST
rsnc [OPTION...] SRC... rsnc://[USER@]HOST[:PORT]/DEST
Usages with just one SRC arg and no DEST arg will list the source Iiles instead oI copying.
DESCRIPTION
Rsync is a Iast and extraordinarily versatile Iile copying tool. It can copy locally, to/Irom another host over any
remote shell, or to/Irom a remote rsync daemon. It oIIers a large number oI options that control every aspect oI
its behavior and permit very Ilexible speciIication oI the set oI Iiles to be copied. It is Iamous Ior its delta-transIer
algorithm, which reduces the amount oI data sent over the network by sending only the diIIerences between the
source Iiles and the existing Iiles in the destination. Rsync is widely used Ior backups and mirroring and as an
improved copy command Ior everyday use.
Rsync Iinds Iiles that need to be transIerred using a "quick check" algorithm (by deIault) that looks Ior Iiles that
have changed in size or in last-modiIied time. Any changes in the other preserved attributes (as requested by
options) are made on the destination Iile directly when the quick check indicates that the Iile's data does not need
to be updated.
1/10/12 rsnc
2/53 www.samba.org/ftp/rsnc/rsnc.html
Se f he addiia feae f c ae:
f cig i, deice, e, g, ad eii
ecde ad ecde-f i iia GNU a
a CVS ecde de f igig he ae fie ha CVS d ige
ca e a aae ee he, icdig h h
de eie e-e iiege
ieiig f fie afe iiie aec c
f a aheicaed c dae (idea f iig)
GENERAL
Rc cie fie eihe f a ee h, ca he ce h (i de cig fie
beee ee h).
Thee ae diffee a f c cac a ee e: ig a ee-he ga a he a
(ch a h h) cacig a c dae diec ia TCP. The ee-he a i ed
heee he ce deiai ah cai a ige c (:) eaa afe a h ecificai. Cacig
a c dae diec hae he he ce deiai ah cai a dbe c (::) eaa
afe a h ecificai, OR he a c:// URL i ecified (ee a he "USING RSYNC-DAEMON
FEATURES VIA A REMOTE-SHELL CONNECTION" eci f a ecei hi ae e).
A a ecia cae, if a ige ce ag i ecified ih a deiai, he fie ae ied i a fa
iia " -".
A eeced, if eihe he ce deiai ah ecif a ee h, he c cc ca (ee a he
--list-onl i).
Rc efe he ca ide a he "cie" ad he ee ide a he "ee". D' cfe "ee" ih a
c dae -- a dae i aa a ee, b a ee ca be eihe a dae a ee-he aed
ce.
SETUP
See he fie README f iaai ici.
Oce iaed, ca e c a achie ha ca acce ia a ee he (a e a e ha
ca acce ig he c dae-de c). F ee afe, a de c e h f i
cicai, b i a hae bee cfiged e a diffee ee he b defa, ch a h eh.
Y ca a ecif a ee he ie, eihe b ig he -e cad ie i, b eig he
RSYNC_RSH eie aiabe.
Ne ha c be iaed bh he ce ad deiai achie.
USAGE
1/10/12 rsnc
3/53 www.samba.org/ftp/rsnc/rsnc.html
Y e c i he ae a e c. Y ecif a ce ad a deiai, e f hich a be
ee.
Peha he be a eai he a i ih e eae:
rsnc -t *.c foo:src/
Thi d afe a fie achig he ae *.c f he ce diec he diec c he achie
f. If a f he fie aead ei he ee e he he c ee-dae c i ed
dae he fie b edig he diffeece. See he ech e f deai.
rsnc -av foo:src/bar /data/tmp
Thi d ecie afe a fie f he diec c/ba he achie f i he /daa//ba
diec he ca achie. The fie ae afeed i "achie" de, hich ee ha bic i,
deice, aibe, eii, ehi, ec. ae eeed i he afe. Addiia, cei i be
ed edce he ie f daa i f he afe.
rsnc -av foo:src/bar/ /data/tmp
A aiig ah he ce chage hi behai aid ceaig a addiia diec ee a he
deiai. Y ca hi f a aiig / a ce a eaig "c he ce f hi diec" a ed
"c he diec b ae", b i bh cae he aibe f he caiig diec ae afeed he
caiig diec he deiai. I he d, each f he fig cad cie he fie i he
ae a, icdig hei eig f he aibe f /de/f:
rsnc -av /src/foo /dest
rsnc -av /src/foo/ /dest/foo
Ne a ha h ad de efeece d' eie a aiig ah c he ce f he defa
diec. F eae, bh f hee c he ee diec' ce i "/de":
rsnc -av host: /dest
rsnc -av host::module /dest
Y ca a e c i ca- de, hee bh he ce ad deiai d' hae a ':' i he ae. I
hi cae i behae ie a ied c cad.
Fia, ca i a he (iabe) de aaiabe f a aica c dae b eaig ff he de
ae:
rsnc somehost.mdomain.com::
See he fig eci f e deai.
ADANCED SAGE
The a f eeig ie fie f a ee h i de b ecifig addiia ee-h ag i
he ae e a he fi, ih he hae ied. F iace, a hee :
1/10/12 rsnc
4/53 www.samba.org/ftp/rsnc/rsnc.html
rsync -av host:file1 :file2 host:file{3,4 /dest/
rsync -av host::modname/file{1,2 host::modname/file3 /dest/
rsync -av host::modname/file1 ::modname/file{3,4
Ode ei f c eied ig ed ace i he SRC, ie hee eae:
rsync -av host:'dir1/file1 dir2/file2' /dest
rsync host::'modname/dir1/file1 modname/dir2/file2' /dest
Thi d-iig i (b defa) i he ae c, b i a ea e a he fi ehd.
If eed afe a fieae ha cai hieace, ca eihe ecif he --protect-args (-s) i,
' eed ecae he hieace i a a ha he ee he i dead. F iace:
rsync -av host:'file\ name\ with\ spaces' /dest
CONNECTING TO AN RSYNC DAEMON
I i a ibe e c ih a ee he a he a. I hi cae i diec cec a
ee c dae, ica ig TCP 873. (Thi bi eie he dae be ig he
ee e, efe he STARTING AN RSYNC DAEMON TO ACCEPT CONNECTIONS eci
be f ifai ha.)
Uig c i hi a i he ae a ig i ih a ee he ece ha:
eihe e a dbe c :: iead f a ige c eaae he hae f he ah,
e a c:// URL.
he fi d f he "ah" i aca a de ae.
he ee dae a i a eage f he da he cec.
if ecif ah ae he ee dae he he i f acceibe ah he dae i be
h.
if ecif ca deiai he a iig f he ecified fie he ee dae i ided.
ecif he --rsh (-e) i.
A eae ha cie a he fie i a ee de aed "c":
rsync -av host::src /dest
Se de he ee dae a eie aheicai. If , i eceie a ad
he cec. Y ca aid he ad b eig he eie aiabe
RSYNC_PASSWORD he ad a e ig he --passord-file i. Thi a be
ef he ciig c.
WARNING: O e e eie aiabe ae iibe a e. O he e ig --
passord-file i eceded.
Y a eabih he ceci ia a eb b eig he eie aiabe RSYNC_PROXY a
hae: ai iig eb . Ne ha eb ' cfigai
ceci 873.
1/10/12 rsnc
5/53 www.samba.org/ftp/rsnc/rsnc.html
Y a a eabih a dae ceci ig a ga a a b eig he eie aiabe
RSYNC_CONNECT_PROG he cad ih i ace f aig a diec ce ceci.
The ig a cai he ecae "%H" eee he hae ecified i he c cad ( e
"%%" if eed a ige "%" i ig). F eae:
eport RSYNC_CONNECT_PROG='ssh prohost nc %H 873'
rsnc -av targethost1::module/src/ /dest/
rsnc -av rsnc:://targethost2/module/src/ /dest/
The cad ecified abe e h c (eca) a h, hich fad a daa 873
(he c dae) he ageh (%H).
USING RSYNC-DAEMON FEATURES VIA A REMOTE-
SHELL CONNECTION
I i eie ef e ai feae f a c dae (ch a aed de) ih aca
aig a e ce ceci i a e (he ha ha i aead eied a ee-he
acce). Rc cecig a h ig a ee he ad he aig a ige-e "dae"
ee ha eec ead i cfig fie i he he di f he ee e. Thi ca be ef if a
ec a dae-e afe' daa, b ice he dae i aed feh b he ee e, a
be abe e feae ch a ch chage he id ed b he dae. (F ahe a ec a
dae afe, cide ig h e a ca a ee achie ad cfige a a c
dae ha ee h a ceci f "cah".)
F he e' eecie, a dae afe ia a ee-he ceci e ea he ae cad-ie
a a a a c-dae afe, ih he ecei beig ha eici e he ee
he ga he cad-ie ih he --rsh=COMMAND i. (Seig he RSYNC_RSH i he
eie i hi fciai.) F eae:
rsnc -av --rsh=ssh host::module /dest
If eed ecif a diffee ee-he e, ee i id ha he e@ efi i f f he h i
ecifig he c-e ae (f a de ha eie e-baed aheicai). Thi ea ha
gie he '- e' i h he ecifig he ee-he, a i hi eae ha e he h ei f
he --rsh i:
rsnc -av -e "ssh -l ssh-user" rsnc-user@host::module /dest
The "h-e" i be ed a he h ee; he "c-e" i be ed g-i he "de".
STARTING AN RSYNC DAEMON TO ACCEPT
CONNECTIONS
I de cec a c dae, he ee e eed hae a dae aead ig ( i eed
hae cfiged ehig ie ied a a c dae f icig ceci a aica
). F f ifai h a a dae ha i hadig icig ce ceci, ee he
rsncd.conf(5) a age -- ha i he cfig fie f he dae, ad i cai he f deai f h
1/10/12 rsnc
6/53 www.samba.org/ftp/rsnc/rsnc.html
he daemon (inclding and-alone and ined configaion).
If o'e ing one of he emoe-hell anpo fo he anfe, hee i no need o manall a an nc
daemon.
SORTED TRANSFER ORDER
Rnc ala o he pecified filename ino i inenal anfe li. Thi handle he meging ogehe of he
conen of idenicall named diecoie, make i ea o emoe dplicae filename, and ma confe
omeone hen he file ae anfeed in a diffeen ode han ha a gien on he command-line.
If o need a paicla file o be anfeed pio o anohe, eihe epaae he file ino diffeen nc call, o
conide ing --dela-updates (hich doen' affec he oed anfe ode, b doe make he final file-
pdaing phae happen mch moe apidl).
EXAMPLES
Hee ae ome eample of ho I e nc.
To backp m ife' home dieco, hich coni of lage MS Wod file and mail folde, I e a con job
ha n
rsync -Cavz . arvidsjaur:backup
each nigh oe a PPP connecion o a dplicae dieco on m machine "aidja".
To nchonie m amba oce ee I e he folloing Makefile age:
get:
rsync -avuzb --exclude '*' samba:samba/ .
put:
rsync -Cavuzb . samba:samba/
sync: get put
hi allo me o nc ih a CVS dieco a he ohe end of he connecion. I hen do CVS opeaion on he
emoe machine, hich ae a lo of ime a he emoe CVS poocol in' e efficien.
I mio a dieco beeen m "old" and "ne" fp ie ih he command:
rsync -az -e ssh --delete ftp/pub/samba nimbus:"ftp/pub/tridge"
Thi i lanched fom con ee fe ho.
OPTIONS SUMMARY
Hee i a ho mma of he opion aailable in nc. Pleae efe o he deailed decipion belo fo a
complee decipion.
1/10/12 rsnc
7/53 www.samba.org/ftp/rsnc/rsnc.html
-v, --verbose increase verbosity
-q, --quiet suppress non-error messages
--no-motd suppress daemon-mode MOTD (see caveat)
-c, --checksum skip based on checksum, not mod-time & size
-a, --archive archive mode; equals -rlptgoD (no -H,-A,-X)
--no-OPTION turn off an implied OPTION (e.g. --no-D)
-r, --recursive recurse into directories
-R, --relative use relative path names
--no-implied-dirs don't send implied dirs with --relative
-b, --backup make backups (see --suffix & --backup-dir)
--backup-dir=DIR make backups into hierarchy based in DIR
--suffix=SUFFIX backup suffix (default w/o --backup-dir)
-u, --update skip files that are newer on the receiver
--inplace update destination files in-place
--append append data onto shorter files
--append-verify --append w/old data in file checksum
-d, --dirs transfer directories without recursing
-l, --links copy symlinks as symlinks
-L, --copy-links transform symlink into referent file/dir
--copy-unsafe-links only "unsafe" symlinks are transformed
--safe-links ignore symlinks that point outside the tree
-k, --copy-dirlinks transform symlink to dir into referent dir
-K, --keep-dirlinks treat symlinked dir on receiver as dir
-H, --hard-links preserve hard links
-p, --perms preserve permissions
-E, --executability preserve executability
--chmod=CHMOD affect file and/or directory permissions
-A, --acls preserve ACLs (implies -p)
-X, --xattrs preserve extended attributes
-o, --owner preserve owner (super-user only)
-g, --group preserve group
--devices preserve device files (super-user only)
--specials preserve special files
-D same as --devices --specials
-t, --times preserve modification times
-O, --omit-dir-times omit directories from --times
--super receiver attempts super-user activities
--fake-super store/recover privileged attrs using xattrs
-S, --sparse handle sparse files efficiently
-n, --dry-run perform a trial run with no changes made
-W, --whole-file copy files whole (w/o delta-xfer algorithm)
-x, --one-file-system don't cross filesystem boundaries
-B, --block-size=SIZE force a fixed checksum block-size
-e, --rsh=COMMAND specify the remote shell to use
--rsync-path=PROGRAM specify the rsync to run on remote machine
--existing skip creating new files on receiver
--ignore-existing skip updating files that exist on receiver
--remove-source-files sender removes synchronized files (non-dir)
--del an alias for --delete-during
--delete delete extraneous files from dest dirs
--delete-before receiver deletes before xfer, not during
--delete-during receiver deletes during the transfer
--delete-delay find deletions during, delete after
--delete-after receiver deletes after transfer, not during
--delete-excluded also delete excluded files from dest dirs
--ignore-errors delete even if there are I/O errors
--force force deletion of dirs even if not empty
1/10/12 rsnc
8/53 www.samba.org/ftp/rsnc/rsnc.html
--a-deee=NUM d' deee e ha NUM fie
--a-ie=SIZE d' afe a fie age ha SIZE
--i-ie=SIZE d' afe a fie ae ha SIZE
--aia ee aia afeed fie
--aia-di=DIR a aia afeed fie i DIR
--dea-dae a daed fie i ace a ed
-, --e-e-di e e diec chai f fie-i
--eic-id d' a id/gid ae b e/g ae
--ie=SECONDS e I/O ie i ecd
--cie=SECONDS e dae ceci ie i ecd
-I, --ige-ie d' i fie ha ach ie ad ie
--ie- i fie ha ach i ie
--dif-id=NUM cae d-ie ih edced accac
-T, --e-di=DIR ceae ea fie i diec DIR
-, --f fid iia fie f bai if de fie
--cae-de=DIR a cae eceied fie eaie DIR
--c-de=DIR ... ad icde cie f chaged fie
--i-de=DIR hadi fie i DIR he chaged
-, --ce ce fie daa dig he afe
--ce-ee=NUM eici e cei ee
--i-ce=LIST i ceig fie ih ffi i LIST
-C, --c-ecde a-ige fie i he ae a CVS de
-f, --fie=RULE add a fie-fieig RULE
-F ae a --fie='di-ege /.c-fie'
eeaed: --fie='- .c-fie'
--ecde=PATTERN ecde fie achig PATTERN
--ecde-f=FILE ead ecde ae f FILE
--icde=PATTERN d' ecde fie achig PATTERN
--icde-f=FILE ead icde ae f FILE
--fie-f=FILE ead i f ce-fie ae f FILE
-0, --f0 a *f/fie fie ae deiied b 0
-, --ec-ag ace-iig; idcad cha
--adde=ADDRESS bid adde f gig ce dae
--=PORT ecif dbe-c aeae be
--c=OPTIONS ecif c TCP i
--bcig-i e bcig I/O f he ee he
--a gie e fie-afe a
-8, --8-bi- eae high-bi cha ecaed i
-h, --ha-eadabe be i a ha-eadabe fa
--ge h ge dig afe
-P ae a --aia --ge
-i, --ieie-chage a chage-a f a dae
---fa=FORMAT dae ig he ecified FORMAT
--g-fie=FILE g ha e'e dig he ecified FILE
--g-fie-fa=FMT g dae ig he ecified FMT
--ad-fie=FILE ead dae-acce ad f FILE
--i- i he fie iead f cig he
--bii=KBPS ii I/O badidh; KBe e ecd
--ie-bach=FILE ie a bached dae FILE
---ie-bach=FILE ie --ie-bach b / daig de
--ead-bach=FILE ead a bached dae f FILE
--c=NUM fce a de c ei be ed
--ic=CONVERT_SPEC ee chae cei f fieae
--chec-eed=NUM e bc/fie chec eed (adaced)
-4, --i4 efe IP4
-6, --i6 efe IP6
--ei i ei be
1/10/12 rsnc
9/53 www.samba.org/ftp/rsnc/rsnc.html
(-h) --help show this help (see below for -h comment)
Rsync can also be run as a daemon, in which case the following options are accepted:
--daemon run as an rsnc daemon
--address=ADDRESS bind to the specified address
--bwlimit=KBPS limit I/O bandwidth; KBtes per second
--config=FILE specif alternate rsncd.conf file
--no-detach do not detach from the parent
--port=PORT listen on alternate port number
--log-file=FILE override the "log file" setting
--log-file-format=FMT override the "log format" setting
--sockopts=OPTIONS specif custom TCP options
-v, --verbose increase verbosit
-4, --ipv4 prefer IPv4
-6, --ipv6 prefer IPv6
-h, --help show this help (if used after --daemon)
OPTIONS
Rsync accepts both long (double-dash + word) and short (single-dash + letter) options. The full list of the
available options are described below. If an option can be specified in more than one way, the choices are
comma-separated. Some options only have a long variant, not a short. If the option takes a parameter, the
parameter is only listed after the long variant, even though it must also be specified for the short. When specifying
a parameter, you can either use the form --option=param or replace the '=' with whitespace. The parameter may
need to be quoted in some manner for it to survive the shell's command-line parsing. Keep in mind that a leading
tilde () in a filename is substituted by your shell, so --option=/foo will not change the tilde into your home
directory (remove the '=' for that).
--help
Print a short help page describing the options available in rsync and exit. For backward-compatibility with
older versions of rsync, the help will also be output if you use the -h option without any other args.
--ersion
print the rsync version number and exit.
-, --erbose
This option increases the amount of information you are given during the transfer. By default, rsync works
silently. A single -v will give you information about what files are being transferred and a brief summary at
the end. Two -v options will give you information on what files are being skipped and slightly more
information at the end. More than two -v options should only be used if you are debugging rsync.
Note that the names of the transferred files that are output are done using a default --out-format of
"%n%L", which tells you just the name of the file and, if the item is a link, where it points. At the single -v
level of verbosity, this does not mention when a file gets its attributes changed. If you ask for an itemized
list of changed attributes (either --itemie-changes or adding "%i" to the --out-format setting), the output
(on the client) increases to mention all items that are changed in any way. See the --out-format option for
more details.
1/10/12 rsnc
10/53 www.samba.org/ftp/rsnc/rsnc.html
-q, --quiet
This option decreases the amount oI inIormation you are given during the transIer, notably suppressing
inIormation messages Irom the remote server. This option is useIul when invoking rsync Irom cron.
--no-motd
This option aIIects the inIormation that is output by the client at the start oI a daemon transIer. This
suppresses the message-oI-the-day (MOTD) text, but it also aIIects the list oI modules that the daemon
sends in response to the "rsync host::" request (due to a limitation in the rsync protocol), so omit this
option iI you want to request the list oI modules Irom the daemon.
-I, --ignore-times
Normally rsync will skip any Iiles that are already the same size and have the same modiIication
timestamp. This option turns oII this "quick check" behavior, causing all Iiles to be updated.
--sie-onl
This modiIies rsync's "quick check" algorithm Ior Iinding Iiles that need to be transIerred, changing it Irom
the deIault oI transIerring Iiles with either a changed size or a changed last-modiIied time to just looking Ior
Iiles that have changed in size. This is useIul when starting to use rsync aIter using another mirroring system
which may not preserve timestamps exactly.
--modif-window
When comparing two timestamps, rsync treats the timestamps as being equal iI they diIIer by no more than
the modiIy-window value. This is normally 0 (Ior an exact match), but you may Iind it useIul to set this to a
larger value in some situations. In particular, when transIerring to or Irom an MS Windows FAT Iilesystem
(which represents times with a 2-second resolution), --modif-window=1 is useIul (allowing times to diIIer
by up to 1 second).
-c, --checksum
This changes the way rsync checks iI the Iiles have been changed and are in need oI a transIer. Without
this option, rsync uses a "quick check" that (by deIault) checks iI each Iile's size and time oI last
modiIication match between the sender and receiver. This option changes this to compare a 128-bit
checksum Ior each Iile that has a matching size. Generating the checksums means that both sides will
expend a lot oI disk I/O reading all the data in the Iiles in the transIer (and this is prior to any reading that
will be done to transIer changed Iiles), so this can slow things down signiIicantly.
The sending side generates its checksums while it is doing the Iile-system scan that builds the list oI the
available Iiles. The receiver generates its checksums when it is scanning Ior changed Iiles, and will
checksum any Iile that has the same size as the corresponding sender's Iile: Iiles with either a changed size
or a changed checksum are selected Ior transIer.
Note that rsync always veriIies that each anfeed Iile was correctly reconstructed on the receiving side
by checking a whole-Iile checksum that is generated as the Iile is transIerred, but that automatic aIter-the-
transIer veriIication has nothing to do with this option's beIore-the-transIer "Does this Iile need to be
updated?" check.
For protocol 30 and beyond (Iirst supported in 3.0.0), the checksum used is MD5. For older protocols,
the checksum used is MD4.
1/10/12 rsnc
11/53 www.samba.org/ftp/rsnc/rsnc.html
-a, --achie
This is equivalent to -rlptgoD. It is a quick way oI saying you want recursion and want to preserve almost
everything (with -H being a notable omission). The only exception to the above equivalence is when --
files-from is speciIied, in which case -r is not implied.
Note that -a does not preserve hardlinks, because Iinding multiply-linked Iiles is expensive. You must
separately speciIy -H.
--no-OPTION
You may turn oII one or more implied options by preIixing the option name with "no-". Not all options
may be preIixed with a "no-": only options that are implied by other options (e.g. --no-D, --no-perms) or
have diIIerent deIaults in various circumstances (e.g. --no-whole-file, --no-blocking-io, --no-dirs). You
may speciIy either the short or the long option name aIter the "no-" preIix (e.g. --no-R is the same as --no-
relative).
For example: iI you want to use -a (--archive) but don't want -o (--owner), instead oI converting -a into -
rlptgD, you could speciIy -a --no-o (or -a --no-owner).
The order oI the options is important: iI you speciIy --no-r -a, the -r option would end up being turned on,
the opposite oI -a --no-r. Note also that the side-eIIects oI the --files-from option are NOT positional, as
it aIIects the deIault state oI several options and slightly changes the meaning oI -a (see the --files-from
option Ior more details).
-, --ecie
This tells rsync to copy directories recursively. See also --dirs (-d).
Beginning with rsync 3.0.0, the recursive algorithm used is now an incremental scan that uses much less
memory than beIore and begins the transIer aIter the scanning oI the Iirst Iew directories have been
completed. This incremental scan only aIIects our recursion algorithm, and does not change a non-
recursive transIer. It is also only possible when both ends oI the transIer are at least version 3.0.0.
Some options require rsync to know the Iull Iile list, so these options disable the incremental recursion
mode. These include: --delete-before, --delete-after, --prune-empt-dirs, and --dela-updates.
Because oI this, the deIault delete mode when you speciIy --delete is now --delete-during when both
ends oI the connection are at least 3.0.0 (use --del or --delete-during to request this improved deletion
mode explicitly). See also the --delete-dela option that is a better choice than using --delete-after.
Incremental recursion can be disabled using the --no-inc-recursive option or its shorter --no-i-r alias.
-R, --elaie
Use relative paths. This means that the Iull path names speciIied on the command line are sent to the
server rather than just the last parts oI the Iilenames. This is particularly useIul when you want to send
several diIIerent directories at the same time. For example, iI you used this command:
rsnc -av /foo/bar/ba.c remote:/tmp/
... this would create a Iile named baz.c in /tmp/ on the remote machine. II instead you used
1/10/12 rsnc
12/53 www.samba.org/ftp/rsnc/rsnc.html
rsnc -avR /foo/bar/ba.c remote:/tmp/
he a fie aed //f/ba/ba.c d be ceaed he ee achie, eeig i f ah.
Thee ea ah eee ae caed "iied diecie" (i.e. he "f" ad he "f/ba" diecie i he
abe eae).
Begiig ih c 3.0.0, c aa ed hee iied diecie a ea diecie i he fie i,
ee if a ah eee i ea a i he edig ide. Thi ee e ea eeced
behai he cig he f ah f a fie ha did' eaie had a i i i ah. If a
dicae a ee-ide i, icde bh he i ia i ah, ad efee diec ia i ea
ah. If 'e deaig ih a de c he edig ide, a eed e he --no-implied-dirs
i.
I i a ibe ii he a f ah ifai ha i e a iied diecie f each ah
ecif. Wih a de c he edig ide (begiig ih 2.6.7), ca ie a d ad a
ah i he ce ah, ie hi:
rsnc -avR /foo/./bar/ba.c remote:/tmp/
Tha d ceae //ba/ba.c he ee achie. (Ne ha he d be fed b a ah,
"/f/." d be abbeiaed.) F de c ei, d eed e a chdi ii he
ce ah. F eae, he hig fie:
(cd /foo; rsnc -avR bar/ba.c remote:/tmp/)
(Ne ha he ae he cad i a b-he, ha he "cd" cad de' eai i
effec f fe cad.) If 'e ig fie f a de c, e hi idi (b f a -
dae afe):
rsnc -avR --rsnc-path="cd /foo; rsnc" \
remote:bar/ba.c /tmp/
--no-implied-di
Thi i affec he defa behai f he --relatie i. Whe i i ecified, he aibe f he
iied diecie f he ce ae ae icded i he afe. Thi ea ha he
cedig ah eee he deiai e ae ef chaged if he ei, ad a iig
iied diecie ae ceaed ih defa aibe. Thi ee a hee iied ah eee hae
big diffeece, ch a beig a i a diec he eceiig ide.
F iace, if a cad-ie ag a fie-f e d c afe he fie "ah/f/fie", he
diecie "ah" ad "ah/f" ae iied he --relatie i ed. If "ah/f" i a i "ba"
he deiai e, he eceiig c d diai deee "ah/f", eceae i a a diec,
ad eceie he fie i he e diec. Wih --no-implied-dirs, he eceiig c dae
"ah/f/fie" ig he eiig ah eee, hich ea ha he fie ed beig ceaed i
"ah/ba". Ahe a accih hi i eeai i e he --keep-dirlinks i (hich
i a affec i diecie i he e f he afe).
Whe ig fie f a c de ha 3.0.0, a eed e hi i if he edig ide ha a
i i he ah ee ad ih he iied diecie be afeed a a
1/10/12 rsnc
13/53 www.samba.org/ftp/rsnc/rsnc.html
directories.
-b, --backup
With this option, preexisting destination files are renamed as each file is transferred or deleted. You can
control where the backup file goes and what (if any) suffix gets appended using the --backup-dir and --
suffix options.
Note that if you don't specify --backup-dir, (1) the --omit-dir-times option will be implied, and (2) if --
delete is also in effect (without --delete-excluded), rsync will add a "protect" filter-rule for the backup
suffix to the end of all your existing excludes (e.g. -f "P *"). This will prevent previously backed-up files
from being deleted. Note that if you are supplying your own filter rules, you may need to manually insert
your own exclude/protect rule somewhere higher up in the list so that it has a high enough priority to be
effective (e.g., if your rules specify a trailing inclusion/exclusion of '*', the auto-added rule would never be
reached).
--backup-dir=DIR
In combination with the --backup option, this tells rsync to store all backups in the specified directory on
the receiving side. This can be used for incremental backups. You can additionally specify a backup suffix
using the --suffix option (otherwise the files backed up in the specified directory will keep their original
filenames).
Note that if you specify a relative path, the backup directory will be relative to the destination directory, so
you probably want to specify either an absolute path or a path that starts with "../". If an rsync daemon is
the receiver, the backup dir cannot go outside the module's path hierarchy, so take extra care not to
delete it or copy into it.
--suffi=SUFFIX
This option allows you to override the default backup suffix used with the --backup (-b) option. The
default suffix is a if no --backup-dir was specified, otherwise it is an empty string.
-u, --update
This forces rsync to skip any files which exist on the destination and have a modified time that is newer
than the source file. (If an existing destination file has a modification time equal to the source file's, it will be
updated if the sizes are different.)
Note that this does not affect the copying of symlinks or other special files. Also, a difference of file format
between the sender and receiver is always considered to be important enough for an update, no matter
what date is on the objects. In other words, if the source has a directory where the destination has a file,
the transfer would occur regardless of the timestamps.
This option is a transfer rule, not an exclude, so it doesn't affect the data that goes into the file-lists, and
thus it doesn't affect deletions. It just limits the files that the receiver requests to be transferred.
--inplace
This option changes how rsync transfers a file when its data needs to be updated: instead of the default
method of creating a new copy of the file and moving it into place when it is complete, rsync instead writes
the updated data directly to the destination file.
1/10/12 rsnc
14/53 www.samba.org/ftp/rsnc/rsnc.html
Thi ha eeal effec:
Had link ae no boken. Thi mean he ne daa ill be iible hogh ohe had
link o he deinaion file. Moeoe, aemp o cop diffeing oce file ono a
mlipl-linked deinaion file ill el in a "g of a" ih he deinaion daa
changing back and foh.
In-e binaie canno be pdaed (eihe he OS ill peen hi fom happening, o
binaie ha aemp o ap-in hei daa ill mibehae o cah).
The file' daa ill be in an inconien ae ding he anfe and ill be lef ha
a if he anfe i ineped o if an pdae fail.
A file ha nc canno ie o canno be pdaed. While a pe e can pdae
an file, a nomal e need o be ganed ie pemiion fo he open of he file fo
iing o be ccefl.
The efficienc of nc' dela-anfe algoihm ma be edced if ome daa in he
deinaion file i oeien befoe i can be copied o a poiion lae in he file. Thi
doe no appl if o e --backup, ince nc i ma enogh o e he backp file
a he bai file fo he anfe.
WARNING: o hold no e hi opion o pdae file ha ae being acceed b ohe, o be
caefl hen chooing o e hi fo a cop.
Thi opion i efl fo anfeing lage file ih block-baed change o appended daa, and alo on
em ha ae dik bond, no neok bond. I can alo help keep a cop-on-ie fileem
napho fom dieging he enie conen of a file ha onl ha mino change.
The opion implie --partial (ince an ineped anfe doe no delee he file), b conflic ih --
partial-dir and --dela-updates. Pio o nc 2.6.4 --inplace a alo incompaible ih --compare-
dest and --link-dest.
--append
Thi cae nc o pdae a file b appending daa ono he end of he file, hich peme ha he daa
ha alead ei on he eceiing ide i idenical ih he a of he file on he ending ide. If a file
need o be anfeed and i ie on he eceie i he ame o longe han he ie on he ende, he
file i kipped. Thi doe no inefee ih he pdaing of a file' non-conen aibe (e.g. pemiion,
onehip, ec.) hen he file doe no need o be anfeed, no doe i affec he pdaing of an non-
egla file. Implie --inplace, b doe no conflic ih --sparse (ince i i ala eending a file'
lengh).
--append-verif
Thi ok j like he --append opion, b he eiing daa on he eceiing ide i inclded in he fll-
file checkm eificaion ep, hich ill cae a file o be een if he final eificaion ep fail (nc
e a nomal, non-appending --inplace anfe fo he eend).
Noe: pio o nc 3.0.0, he --append opion oked like --append-verif, o if o ae ineacing
ih an olde nc (o he anfe i ing a poocol pio o 30), pecifing eihe append opion ill
iniiae an --append-verif anfe.
1/10/12 rsnc
15/53 www.samba.org/ftp/rsnc/rsnc.html
-d, --dirs
Tell he ending ide o inclde an diecoie ha ae enconeed. Unlike --recursive, a dieco'
conen ae no copied nle he dieco name pecified i "." o end ih a ailing lah (e.g. ".",
"di/.", "di/", ec.). Wiho hi opion o he --recursive opion, nc ill kip all diecoie i
encone (and op a meage o ha effec fo each one). If o pecif boh --dirs and --recursive,
--recursive ake pecedence.
The --dirs opion i implied b he --files-from opion o he --list-onl opion (inclding an implied --
list-onl age) if --recursive an' pecified (o ha diecoie ae een in he liing). Specif --no-
dirs (o --no-d) if o an o n hi off.
Thee i alo a backad-compaibili helpe opion, --old-dirs (o --old-d) ha ell nc o e a hack
of "- --eclde='/*/*'" o ge an olde nc o li a ingle dieco iho ecing.
-l, --links
When mlink ae enconeed, eceae he mlink on he deinaion.
-L, --cop-links
When mlink ae enconeed, he iem ha he poin o (he efeen) i copied, ahe han he
mlink. In olde eion of nc, hi opion alo had he ide-effec of elling he eceiing ide o follo
mlink, ch a mlink o diecoie. In a moden nc ch a hi one, o'll need o pecif --
keep-dirlinks (-K) o ge hi ea behaio. The onl ecepion i hen ending file o an nc ha i
oo old o ndeand -K -- in ha cae, he -L opion ill ill hae he ide-effec of -K on ha olde
eceiing nc.
--cop-unsafe-links
Thi ell nc o cop he efeen of mbolic link ha poin oide he copied ee. Abole mlink
ae alo eaed like odina file, and o ae an mlink in he oce pah ielf hen --relative i
ed. Thi opion ha no addiional effec if --cop-links a alo pecified.
--safe-links
Thi ell nc o ignoe an mbolic link hich poin oide he copied ee. All abole mlink ae
alo ignoed. Uing hi opion in conjncion ih --relative ma gie nepeced el.
-k, --cop-dirlinks
Thi opion cae he ending ide o ea a mlink o a dieco a hogh i ee a eal dieco. Thi
i efl if o don' an mlink o non-diecoie o be affeced, a he old be ing --cop-links.
Wiho hi opion, if he ending ide ha eplaced a dieco ih a mlink o a dieco, he eceiing
ide ill delee anhing ha i in he a of he ne mlink, inclding a dieco hieach (a long a --
force o --delete i in effec).
See alo --keep-dirlinks fo an analogo opion fo he eceiing ide.
--cop-dirlinks applie o all mlink o diecoie in he oce. If o an o follo onl a fe
pecified mlink, a ick o can e i o pa hem a addiional oce ag ih a ailing lah, ing -
-relative o make he pah mach p igh. Fo eample:
1/10/12 rsnc
16/53 www.samba.org/ftp/rsnc/rsnc.html
rsnc -r --relative src/./ src/./follow-me/ dest/
Thi becae c ca lstat(2) he ce ag a gie, ad he aiig ah ae lstat(2)
f he i, giig ie a diec i he fie-i hich eide he i fd dig he
ca f "c/./".
-K, --keep-dilink
Thi i cae he eceiig ide ea a i a diec a hgh i ee a ea diec,
b if i ache a ea diec f he ede. Wih hi i, he eceie' i d be
deeed ad eaced ih a ea diec.
F eae, e afe a diec "f" ha cai a fie "fie", b "f" i a i
diec "ba" he eceie. Wih --keep-dirlinks, he eceie deee i "f", eceae i a
a diec, ad eceie he fie i he e diec. Wih --keep-dirlinks, he eceie ee he
i ad "fie" ed i "ba".
Oe e f cai: if e --keep-dirlinks, a he i i he c! If i i ibe
f a ed e ceae hei i a diec, he e cd he ( a bee
c) eace he i ih a ea diec ad affec he ce f haee diec he i
efeece. F bac cie, ae bee ff ig ehig ie a bid iead f a i
dif eceiig hieach.
See a --cop-dirlinks f a aag i f he edig ide.
-H, --had-link
Thi e c f had-ied fie i he ce ad i gehe he cedig fie he
deiai. Wih hi i, had-ied fie i he ce ae eaed a hgh he ee eaae
fie.
Thi i de NOT eceai ee ha he ae f had i he deiai eac ache
ha he ce. Cae i hich he deiai a ed ih ea had i icde he fig:
If he deiai cai eae had-i (e iig ha ha i ee i
he ce fie i), he cig agih i bea he eici. Hee, if
e e f he ah hae ce diffeece, he a fie-dae ce i
bea he ea i (e ae ig he --inplace i).
If ecif a --link-dest diec ha cai had i, he iig f he
deiai fie agai he --link-dest fie ca cae e ah i he deiai
bece ied gehe de he --link-dest aciai.
Ne ha c ca deec had i beee fie ha ae iide he afe e. If c dae a
fie ha ha ea had-i ceci fie ide he afe, ha iage i be be. If ae
eed e he --inplace i aid hi beaage, be e caef ha h fie
ae beig daed ha ae ceai ha ieded chage hae de igeig had i
(ad ee he --inplace i f e caea).
If iceea eci i acie (ee --recursive), c a afe a iig had-ied fie befe i
fid ha ahe i f ha ce ei eehee i he hieach. Thi de affec he accac
1/10/12 rsnc
17/53 www.samba.org/ftp/rsnc/rsnc.html
of the transfer (i.e. which files are hard-linked together), just its efficiency (i.e. copying the data for a new,
early copy of a hard-linked file that could have been found later in the transfer in another member of the
hard-linked set of files). One way to avoid this inefficiency is to disable incremental recursion using the --
no-inc-recursive option.
-p, --perms
This option causes the receiving rsync to set the destination permissions to be the same as the source
permissions. (See also the --chmod option for a way to modify what rsync considers to be the source
permissions.)
When this option is ff, permissions are set as follows:
Existing files (including updated files) retain their existing permissions, though the --
executability option might change just the execute permission for the file.
New files get their "normal" permission bits set to the source file's permissions masked
with the receiving directory's default permissions (either the receiving process's umask,
or the permissions specified via the destination directory's default ACL), and their
special permission bits disabled except in the case where a new directory inherits a
setgid bit from its parent directory.
Thus, when --perms and --executability are both disabled, rsync's behavior is the same as that of other
file-copy utilities, such as cp(1) and tar(1).
In summary: to give destination files (both old and new) the source permissions, use --perms. To give new
files the destination-default permissions (while leaving existing files unchanged), make sure that the --
perms option is off and use --chmodugorwX (which ensures that all non-masked bits get enabled). If
you'd care to make this latter behavior easier to type, you could define a popt alias for it, such as putting
this line in the file /.popt (the following defines the -Z option, and includes --no-g to use the default group
of the destination dir):
rsnc alias -Z --no-p --no-g --chmod=ugo=rwX
You could then use this new option in a command such as this one:
rsnc -avZ src/ dest/
(Caveat: make sure that -a does not follow -Z, or it will re-enable the two "--no-*" options mentioned
above.)
The preservation of the destination's setgid bit on newly-created directories when --perms is off was
added in rsync 2.6.7. Older rsync versions erroneously preserved the three special permission bits for
newly-created files when --perms was off, while overriding the destination's setgid bit setting on a newly-
created directory. Default ACL observance was added to the ACL patch for rsync 2.6.7, so older (or
non-ACL-enabled) rsyncs use the umask even if default ACLs are present. (Keep in mind that it is the
version of the receiving rsync that affects these behaviors.)
-E, --eecutabilit
This option causes rsync to preserve the executability (or non-executability) of regular files when --perms
1/10/12 rsnc
18/53 www.samba.org/ftp/rsnc/rsnc.html
i no enabled. A egla file i conideed o be eecable if a lea one '' i ned on in i pemiion.
When an eiing deinaion file' eecabili diffe fom ha of he coeponding oce file, nc
modifie he deinaion file' pemiion a follo:
To make a file non-eecable, nc n off all i '' pemiion.
To make a file eecable, nc n on each '' pemiion ha ha a coeponding
'' pemiion enabled.
If --perms i enabled, hi opion i ignoed.
-A, --acls
Thi opion cae nc o pdae he deinaion ACL o be he ame a he oce ACL. The opion
alo implie --perms.
The oce and deinaion em m hae compaible ACL enie fo hi opion o ok popel.
See he --fake-super opion fo a a o backp and eoe ACL ha ae no compaible.
-X, --attrs
Thi opion cae nc o pdae he deinaion eended aibe o be he ame a he oce one.
Fo em ha ppo eended-aibe namepace, a cop being done b a pe-e copie all
namepace ecep em.*. A nomal e onl copie he e.* namepace. To be able o backp and
eoe non-e namepace a a nomal e, ee he --fake-super opion.
Noe ha hi opion doe no cop nc pecial a ale (e.g. hoe ed b --fake-super) nle
o epea he opion (e.g. -XX). Thi "cop all a" mode canno be ed ih --fake-super.
--chmod
Thi opion ell nc o appl one o moe comma-epaaed "chmod" mode o he pemiion of he
file in he anfe. The eling ale i eaed a hogh i ee he pemiion ha he ending ide
pplied fo he file, hich mean ha hi opion can eem o hae no effec on eiing file if --perms i
no enabled.
In addiion o he nomal paing le pecified in he chmod(1) manpage, o can pecif an iem ha
hold onl appl o a dieco b pefiing i ih a 'D', o pecif an iem ha hold onl appl o a file
b pefiing i ih a 'F'. Fo eample, he folloing ill ene ha all diecoie ge maked e-gid, ha
no file ae ohe-iable, ha boh ae e-iable and gop-iable, and ha boh hae conien
eecabili aco all bi:
--chmod=Dg+,g+,Fo-,+X
I i alo legal o pecif mliple --chmod opion, a each addiional opion i j appended o he li of
change o make.
See he --perms and --eecutabilit opion fo ho he eling pemiion ale can be applied o he
file in he anfe.
-o, --oner
1/10/12 rsnc
19/53 www.samba.org/ftp/rsnc/rsnc.html
This option causes rsync to set the owner oI the destination Iile to be the same as the source Iile, but only
iI the receiving rsync is being run as the super-user (see also the --pe and --fake-pe options).
Without this option, the owner oI new and/or transIerred Iiles are set to the invoking user on the receiving
side.
The preservation oI ownership will associate matching names by deIault, but may Iall back to using the ID
number in some circumstances (see also the --nmeic-id option Ior a Iull discussion).
-g, --gop
This option causes rsync to set the group oI the destination Iile to be the same as the source Iile. II the
receiving program is not running as the super-user (or iI --no-pe was speciIied), only groups that the
invoking user on the receiving side is a member oI will be preserved. Without this option, the group is set
to the deIault group oI the invoking user on the receiving side.
The preservation oI group inIormation will associate matching names by deIault, but may Iall back to using
the ID number in some circumstances (see also the --nmeic-id option Ior a Iull discussion).
--deice
This option causes rsync to transIer character and block device Iiles to the remote system to recreate
these devices. This option has no eIIect iI the receiving rsync is not run as the super-user (see also the --
pe and --fake-pe options).
--pecial
This option causes rsync to transIer special Iiles such as named sockets and IiIos.
-D
The -D option is equivalent to --deice --pecial.
-, --ime
This tells rsync to transIer modiIication times along with the Iiles and update them on the remote system.
Note that iI this option is not used, the optimization that excludes Iiles that have not been modiIied cannot
be eIIective; in other words, a missing - or -a will cause the next transIer to behave as iI it used -I, causing
all Iiles to be updated (though rsync's delta-transIer algorithm will make the update Iairly eIIicient iI the Iiles
haven't actually changed, you're much better oII using -).
-O, --omi-di-ime
This tells rsync to omit directories when it is preserving modiIication times (see --ime). II NFS is sharing
the directories on the receiving side, it is a good idea to use -O. This option is inIerred iI you use --backp
without --backp-di.
--pe
This tells the receiving side to attempt super-user activities even iI the receiving rsync wasn't run by the
super-user. These activities include: preserving users via the --one option, preserving all groups (not just
the current user's groups) via the --gop option, and copying devices via the --deice option. This is
useIul Ior systems that allow such activities without being the super-user, and also Ior ensuring that you will
get errors iI the receiving side isn't being run as the super-user. To turn oII super-user activities, the super-
user can use --no-pe.
1/10/12 rsnc
20/53 www.samba.org/ftp/rsnc/rsnc.html
--fake-super
Whe hi i i eabed, c iae e-e aciiie b aig/eig he iieged
aibe ia ecia eeded aibe ha ae aached each fie (a eeded). Thi icde he fie'
e ad g (if i i he defa), he fie' deice if (deice & ecia fie ae ceaed a e
e fie), ad a eii bi ha e ' a be e he ea fie (e.g. he ea fie ge -,g-
,- f afe) ha d ii he e' acce (ice he ea e-e ca aa acce/chage
a fie, he fie e ceae ca aa be acceed/chaged b he ceaig e). Thi i a hade
ACL (if --acls a ecified) ad -e eeded aibe (if --xattrs a ecified).
Thi i a gd a bac daa ih ig a e-e, ad e ACL f icaibe
e.
The --fake-super i affec he ide hee he i i ed. T affec he ee ide f a
ee-he ceci, ecif a c ah:
rsnc -av --rsnc-path="rsnc --fake-super" /src/ host:/dest/
Sice hee i e "ide" i a ca c, hi i affec bh he edig ad eceiig f fie.
Y' eed ecif a c ig "cah" if eed aid hi, ib ig he "h" he ci
(f he diec) a a bie f a aca ee he (ee --rsh).
Thi i i eidde b bh --super ad --no-super.
See a he "fae e" eig i he dae' cd.cf fie.
-S, --sparse
T hade ae fie efficie he ae e ace he deiai. Cfic ih --inplace
becae i' ibe eie daa i a ae fahi.
-n, --dr-run
Thi ae c ef a ia ha de' ae a chage (ad dce he ae
a a ea ). I i c ed i cbiai ih he -v, --verbose ad/ -i, --itemie-
changes i ee ha a c cad i gig d befe e aca i.
The f --itemie-changes i ed be eac he ae a d ad a bee ea
(baig ieia ice ad e ca faie); if i i', ha' a bg. Ohe hd be
chaged, b a diffe i e aea. Nab, a d de ed he aca daa f fie
afe, --progress ha effec, he "be e", "be eceied", "iea daa", ad "ached daa"
aiic ae a, ad he "eed" ae i eiae a hee fie afe ee eeded.
-W, --hole-file
Wih hi i c' dea-afe agih i ed ad he he fie i e a-i iead. The
afe a be fae if hi i i ed he he badidh beee he ce ad deiai
achie i highe ha he badidh di (eecia he he "di" i aca a eed
fiee). Thi i he defa he bh he ce ad deiai ae ecified a ca ah, b if
bach-iig i i i effec.
-, --one-file-sstem
1/10/12 rsnc
21/53 www.samba.org/ftp/rsnc/rsnc.html
This tells rsync to avoid crossing a Iilesystem boundary when recursing. This does not limit the user's
ability to speciIy items to copy Irom multiple Iilesystems, just rsync's recursion through the hierarchy oI
each directory that the user speciIied, and also the analogous recursion on the receiving side during
deletion. Also keep in mind that rsync treats a "bind" mount to the same device as being on the same
Iilesystem.
II this option is repeated, rsync omits all mount-point directories Irom the copy. Otherwise, it includes an
empty directory at each mount-point it encounters (using the attributes oI the mounted directory because
those oI the underlying mount-point directory are inaccessible).
II rsync has been told to collapse symlinks (via --cop-links or --cop-unsafe-links), a symlink to a
directory on another device is treated like a mount-point. Symlinks to non-directories are unaIIected by
this option.
--eisting, --ignore-non-eisting
This tells rsync to skip creating Iiles (including directories) that do not exist yet on the destination. II this
option is combined with the --ignore-eisting option, no Iiles will be updated (which can be useIul iI all
you want to do is delete extraneous Iiles).
This option is a transIer rule, not an exclude, so it doesn't aIIect the data that goes into the Iile-lists, and
thus it doesn't aIIect deletions. It just limits the Iiles that the receiver requests to be transIerred.
--ignore-eisting
This tells rsync to skip updating Iiles that already exist on the destination (this does no ignore existing
directories, or nothing would get done). See also --eisting.
This option is a transIer rule, not an exclude, so it doesn't aIIect the data that goes into the Iile-lists, and
thus it doesn't aIIect deletions. It just limits the Iiles that the receiver requests to be transIerred.
This option can be useIul Ior those doing backups using the --link-dest option when they need to continue
a backup run that got interrupted. Since a --link-dest run is copied into a new directory hierarchy (when it
is used properly), using --ignore eisting will ensure that the already-handled Iiles don't get tweaked
(which avoids a change in permissions on the hard-linked Iiles). This does mean that this option is only
looking at the existing Iiles in the destination hierarchy itselI.
--remove-source-files
This tells rsync to remove Irom the sending side the Iiles (meaning non-directories) that are a part oI the
transIer and have been successIully duplicated on the receiving side.
Note that you should only use this option on source Iiles that are quiescent. II you are using this to move
Iiles that show up in a particular directory over to another host, make sure that the Iinished Iiles get
renamed into the source directory, not directly written into it, so that rsync can't possibly transIer a Iile that
is not yet Iully written. II you can't Iirst write the Iiles into a diIIerent directory, you should use a naming
idiom that lets rsync avoid transIerring Iiles that are not yet Iinished (e.g. name the Iile "Ioo.new" when it is
written, rename it to "Ioo" when it is done, and then use the option --eclude='*.ne' Ior the rsync
transIer).
1/10/12 rsnc
22/53 www.samba.org/ftp/rsnc/rsnc.html
--delete
Thi e c deee eae fie f he eceiig ide (e ha ae' he edig ide), b
f he diecie ha ae beig chied. Y hae aed c ed he he
diec (e.g. "di" "di/") ih ig a idcad f he diec' ce (e.g. "di/*") ice he
idcad i eaded b he he ad c h ge a ee afe idiida fie, he fie'
ae diec. Fie ha ae ecded f he afe ae a ecded f beig deeed e
e he --delete-ecluded i a he e a achig he edig ide (ee he
icde/ecde difie i he FILTER RULES eci).
Pi c 2.6.7, hi i d hae effec e --recursive a eabed. Begiig ih
2.6.7, deei i a cc he --dirs (-d) i eabed, b f diecie he ce ae
beig cied.
Thi i ca be dage if ed icec! I i a e gd idea fi a ig he --dr-
run i (-n) ee ha fie ae gig be deeed.
If he edig ide deec a I/O e, he he deei f a fie a he deiai i be
aaica diabed. Thi i ee ea fiee faie (ch a NFS e) he
edig ide f caig a aie deei f fie he deiai. Y ca eide hi ih he --
ignore-errors i.
The --delete i a be cbied ih e f he --deee-WHEN i ih cfic, a e
a --delete-ecluded. Hee, if e f he --deee-WHEN i ae ecified, c i che
he --delete-during agih he aig c 3.0.0 ee, ad he --delete-before agih
he aig a de c. See a --delete-dela ad --delete-after.
--delete-before
Ree ha he fie-deei he eceiig ide be de befe he afe a. See --delete (hich
i iied) f e deai fie-deei.
Deeig befe he afe i hef if he fiee i igh f ace ad eig eae fie
d he ae he afe ibe. Hee, i de idce a dea befe he a f he
afe, ad hi dea igh cae he afe ie (if --timeout a ecified). I a fce c
e he d, -iceea eci agih ha eie c ca a he fie i he afe
i e a ce (ee --recursive).
--delete-during, --del
Ree ha he fie-deei he eceiig ide be de iceea a he afe hae. The
e-diec deee ca i de igh befe each diec i checed f dae, i behae ie a
e efficie --delete-before, icdig dig he deei i a e-diec fie fie beig
daed. Thi i a fi added i c ei 2.6.4. See --delete (hich i iied) f e
deai fie-deei.
--delete-dela
Ree ha he fie-deei he eceiig ide be ced dig he afe (ie --delete-
during), ad he eed afe he afe cee. Thi i ef he cbied ih --dela-
updates ad/ --fu, ad i e efficie ha ig --delete-after (b ca behae diffee, ice -
1/10/12 rsnc
23/53 www.samba.org/ftp/rsnc/rsnc.html
-delete-after computes the deletions in a separate pass aIter all updates are done). II the number oI
removed Iiles overIlows an internal buIIer, a temporary Iile will be created on the receiving side to hold the
names (it is removed while open, so you shouldn't see it during the transIer). II the creation oI the
temporary Iile Iails, rsync will try to Iall back to using --delete-after (which it cannot do iI --recursive is
doing an incremental scan). See --delete (which is implied) Ior more details on Iile-deletion.
--delete-after
Request that the Iile-deletions on the receiving side be done aIter the transIer has completed. This is useIul
iI you are sending new per-directory merge Iiles as a part oI the transIer and you want their exclusions to
take eIIect Ior the delete phase oI the current transIer. It also Iorces rsync to use the old, non-incremental
recursion algorithm that requires rsync to scan all the Iiles in the transIer into memory at once (see --
recursive). See --delete (which is implied) Ior more details on Iile-deletion.
--delete-excluded
In addition to deleting the Iiles on the receiving side that are not on the sending side, this tells rsync to also
delete any Iiles on the receiving side that are excluded (see --exclude). See the FILTER RULES section
Ior a way to make individual exclusions behave this way on the receiver, and Ior a way to protect Iiles
Irom --delete-excluded. See --delete (which is implied) Ior more details on Iile-deletion.
--ignore-errors
Tells --delete to go ahead and delete Iiles even when there are I/O errors.
--force
This option tells rsync to delete a non-empty directory when it is to be replaced by a non-directory. This is
only relevant iI deletions are not active (see --delete Ior details).
Note Ior older rsync versions: --force used to still be required when using --delete-after, and it used to
be non-Iunctional unless the --recursive option was also enabled.
--max-delete=NUM
This tells rsync not to delete more than NUM Iiles or directories. II that limit is exceeded, a warning is
output and rsync exits with an error code oI 25 (new Ior 3.0.0).
Also new Ior version 3.0.0, you may speciIy --max-delete=0 to be warned about any extraneous Iiles in
the destination without removing any oI them. Older clients interpreted this as "unlimited", so iI you don't
know what version the client is, you can use the less obvious --max-delete=-1 as a backward-compatible
way to speciIy that no deletions be allowed (though older versions didn't warn when the limit was
exceeded).
--max-sie=SIZE
This tells rsync to avoid transIerring any Iile that is larger than the speciIied SIZE. The SIZE value can be
suIIixed with a string to indicate a size multiplier, and may be a Iractional value (e.g. "--max-sie=1.5m").
This option is a transIer rule, not an exclude, so it doesn't aIIect the data that goes into the Iile-lists, and
thus it doesn't aIIect deletions. It just limits the Iiles that the receiver requests to be transIerred.
The suIIixes are as Iollows: "K" (or "KiB") is a kibibyte (1024), "M" (or "MiB") is a mebibyte
1/10/12 rsnc
24/53 www.samba.org/ftp/rsnc/rsnc.html
(1024*1024), and "G" (or "GiB") is a gibibyte (1024*1024*1024). II you want the multiplier to be 1000
instead oI 1024, use "KB", "MB", or "GB". (Note: lower-case is also accepted Ior all values.) Finally, iI
the suIIix ends in either "1" or "-1", the value will be oIIset by one byte in the indicated direction.
Examples: --max-size1.5mb-1 is 1499999 bytes, and --max-size2g1 is 2147483649 bytes.
--min-sie=SIZE
This tells rsync to avoid transIerring any Iile that is smaller than the speciIied SIZE, which can help in not
transIerring small, junk Iiles. See the --max-sie option Ior a description oI SIZE and other inIormation.
-B, --block-sie=BLOCKSIZE
This Iorces the block size used in rsync's delta-transIer algorithm to a Iixed value. It is normally selected
based on the size oI each Iile being updated. See the technical report Ior details.
-e, --rsh=COMMAND
This option allows you to choose an alternative remote shell program to use Ior communication between
the local and remote copies oI rsync. Typically, rsync is conIigured to use ssh by deIault, but you may
preIer to use rsh on a local network.
II this option is used with [user@]host::module/path, then the remote shell CAD will be used to
run an rsync daemon on the remote host, and all data will be transmitted through that remote shell
connection, rather than through a direct socket connection to a running rsync daemon on the remote host.
See the section "USING RSYNC-DAEMON FEATURES VIA A REMOTE-SHELL
CONNECTION" above.
Command-line arguments are permitted in COMMAND provided that COMMAND is presented to
rsync as a single argument. You must use spaces (not tabs or other whitespace) to separate the command
and args Irom each other, and you can use single- and/or double-quotes to preserve spaces in an
argument (but not backslashes). Note that doubling a single-quote inside a single-quoted string gives you a
single-quote; likewise Ior double-quotes (though you need to pay attention to which quotes your shell is
parsing and which quotes rsync is parsing). Some examples:
-e 'ssh -p 2234'
-e 'ssh -o "ProCommand nohup ssh fireall nc -1 %h %p"'
(Note that ssh users can alternately customize site-speciIic connect options in their .ssh/conIig Iile.)
You can also choose the remote shell program using the RSYNCRSH environment variable, which
accepts the same range oI values as -e.
See also the --blocking-io option which is aIIected by this option.
--rsnc-path=PROGRAM
Use this to speciIy what program is to be run on the remote machine to start-up rsync. OIten used when
rsync is not in the deIault remote-shell's path (e.g. --rsync-path/usr/local/bin/rsync). Note that
PROGRAM is run with the help oI a shell, so it can be any program, script, or command sequence you'd
care to run, so long as it does not corrupt the standard-in & standard-out that rsync is using to
communicate.
1/10/12 rsnc
25/53 www.samba.org/ftp/rsnc/rsnc.html
Oe ic eae i e a diffee defa diec he ee achie f e ih he --relatie
i. F iace:
rsync -avR --rsync-path="cd /a/b && rsync" host:c/d /e/
-C, --cvs-eclude
Thi i a ef hhad f ecdig a bad age f fie ha fe d' a afe beee
e. I e a iia agih CVS deeie if a fie hd be iged.
The ecde i i iiiaied ecde he fig ie (hee iiia ie ae aed a eihabe --
ee he FILTER RULES eci):
RCS SCCS CVS CVS.adm RCSLOG cvslog.* tags TAGS .make.state
.nse_depinfo * #* .#* ,* _$* *$ *.old *.bak *.BAK *.orig
*.rej .del-* *.a *.olb *.o *.obj *.so *.exe *.Z *.elc *.ln
core .svn/ .git/ .hg/ .bzr/
he, fie ied i a $HOME/.cige ae added he i ad a fie ied i he CVSIGNORE
eie aiabe (a cige ae ae deiied b hieace).
Fia, a fie i iged if i i i he ae diec a a .cige fie ad ache e f he ae
ied heei. Uie c' fie/ecde fie, hee ae ae i hieace. See he cs(1)
aa f e ifai.
If 'e cbiig -C ih --filter e, hd e ha hee CVS ecde ae
aeded a he ed f e, egade f hee he -C a aced he cad-ie. Thi
ae he a e ii ha a e ecified eici. If a c hee hee
CVS ecde ge ieed i fie e, hd i he -C a a cad-ie i ad e
a cbiai f --filter=:C ad --filter=-C (eihe cad-ie b ig he ":C" ad "-C"
e i a fie fie ih he e). The fi i he e-diec caig f he
.cige fie. The ecd i de a e-ie i f he CVS ecde eied abe.
-f, --filter=RULE
Thi i a add e eecie ecde ceai fie f he i f fie be afeed.
Thi i ef i cbiai ih a ecie afe.
Y a e a a --filter i he cad ie a ie bid he i f fie
ecde. If he fie cai hieace, be e e i ha he he gie he e c a a
ige age. The e be a ei ha ca e a dece eace he ace ha
eaae a e f i ag.
See he FILTER RULES eci f deaied ifai hi i.
-F
The -F i i a hhad f addig --filter e cad. The fi ie i i ed i a
hhad f hi e:
--filter='dir-merge /.rsync-filter'
1/10/12 rsnc
26/53 www.samba.org/ftp/rsnc/rsnc.html
Thi ell nc o look fo pe-dieco .nc-file file ha hae been pinkled hogh he hieach
and e hei le o file he file in he anfe. If -F i epeaed, i i a hohand fo hi le:
--filter='eclude .rsnc-filter'
Thi file o he .nc-file file hemele fom he anfe.
See he FILTER RULES ecion fo deailed infomaion on ho hee opion ok.
--eclude=PATTERN
Thi opion i a implified fom of he --filter opion ha defal o an eclde le and doe no allo he
fll le-paing na of nomal file le.
See he FILTER RULES ecion fo deailed infomaion on hi opion.
--eclude-from=FILE
Thi opion i elaed o he --eclude opion, b i pecifie a FILE ha conain eclde paen (one
pe line). Blank line in he file and line aing ih ';' o '#' ae ignoed. If FIE i -, he li ill be ead
fom andad inp.
--include=PATTERN
Thi opion i a implified fom of he --filter opion ha defal o an inclde le and doe no allo he
fll le-paing na of nomal file le.
See he FILTER RULES ecion fo deailed infomaion on hi opion.
--include-from=FILE
Thi opion i elaed o he --include opion, b i pecifie a FILE ha conain inclde paen (one
pe line). Blank line in he file and line aing ih ';' o '#' ae ignoed. If FIE i -, he li ill be ead
fom andad inp.
--files-from=FILE
Uing hi opion allo o o pecif he eac li of file o anfe (a ead fom he pecified FILE o
- fo andad inp). I alo eak he defal behaio of nc o make anfeing j he pecified
file and diecoie eaie:
The --relative (-R) opion i implied, hich peee he pah infomaion ha i
pecified fo each iem in he file (e --no-relative o --no-R if o an o n ha
off).
The --dirs (-d) opion i implied, hich ill ceae diecoie pecified in he li on
he deinaion ahe han noiil kipping hem (e --no-dirs o --no-d if o an o
n ha off).
The --archive (-a) opion' behaio doe no impl --recursive (-r), o pecif i
eplicil, if o an i.
Thee ide-effec change he defal ae of nc, o he poiion of he --files-from
opion on he command-line ha no beaing on ho ohe opion ae paed (e.g. -a
ok he ame befoe o afe --files-from, a doe --no-R and all ohe opion).
1/10/12 rsnc
27/53 www.samba.org/ftp/rsnc/rsnc.html
The filenames that are read from the FILE are all relative to the source dir -- any leading slashes are
removed and no ".." references are allowed to go higher than the source dir. For example, take this
command:
rsnc -a --files-from=/tmp/foo /usr remote:/backup
If /tmp/foo contains the string "bin" (or even "/bin"), the /usr/bin directory will be created as /backup/bin on
the remote host. If it contains "bin/" (note the trailing slash), the immediate contents of the directory would
also be sent (without needing to be explicitly mentioned in the file -- this began in version 2.6.4). In both
cases, if the -r option was enabled, that dir's entire hierarchy would also be transferred (keep in mind that
-r needs to be specified explicitly with --files-from, since it is not implied by -a). Also note that the effect
of the (enabled by default) --relative option is to duplicate only the path info that is read from the file -- it
does not force the duplication of the source-spec path (/usr in this case).
In addition, the --files-from file can be read from the remote host instead of the local host if you specify a
"host:" in front of the file (the host must match one end of the transfer). As a short-cut, you can specify just
a prefix of ":" to mean "use the remote end of the transfer". For example:
rsnc -a --files-from=:/path/file-list src:/ /tmp/cop
This would copy all the files specified in the /path/file-list file that was located on the remote "src" host.
If the --iconv and --protect-args options are specified and the --files-from filenames are being sent from
one host to another, the filenames will be translated from the sending host's charset to the receiving host's
charset.
NOTE: sorting the list of files in the --files-from input helps rsync to be more efficient, as it will avoid re-
visiting the path elements that are shared between adjacent entries. If the input is not sorted, some path
elements (implied directories) may end up being scanned multiple times, and rsync will eventually
unduplicate them after they get turned into file-list elements.
-0, --fom0
This tells rsync that the rules/filenames it reads from a file are terminated by a null ('\0') character, not a
NL, CR, or CR+LF. This affects --eclude-from, --include-from, --files-from, and any merged files
specified in a --filter rule. It does not affect --cvs-eclude (since all names read from a .cvsignore file are
split on whitespace).
-, --poec-ag
This option sends all filenames and most options to the remote rsync without allowing the remote shell to
interpret them. This means that spaces are not split in names, and any non-wildcard special characters are
not translated (such as , $, ;, &, etc.). Wildcards are expanded on the remote host by rsync (instead of
the shell doing it).
If you use this option with --iconv, the args related to the remote side will also be translated from the local
to the remote character-set. The translation happens before wild-cards are expanded. See also the --
files-from option.
-T, --emp-di=DIR
1/10/12 rsnc
28/53 www.samba.org/ftp/rsnc/rsnc.html
Thi opion inc nc o e DIR a a cach dieco hen ceaing empoa copie of he file
anfeed on he eceiing ide. The defal behaio i o ceae each empoa file in he ame
dieco a he aociaed deinaion file.
Thi opion i mo ofen ed hen he eceiing dik paiion doe no hae enogh fee pace o hold a
cop of he lage file in he anfe. In hi cae (i.e. hen he cach dieco i on a diffeen dik
paiion), nc ill no be able o ename each eceied empoa file oe he op of he aociaed
deinaion file, b inead m cop i ino place. Rnc doe hi b coping he file oe he op of he
deinaion file, hich mean ha he deinaion file ill conain ncaed daa ding hi cop. If hi
ee no done hi a (een if he deinaion file ee fi emoed, he daa locall copied o a
empoa file in he deinaion dieco, and hen enamed ino place) i old be poible fo he old
file o conine aking p dik pace (if omeone had i open), and h hee migh no be enogh oom o
fi he ne eion on he dik a he ame ime.
If o ae ing hi opion fo eaon ohe han a hoage of dik pace, o ma ih o combine i
ih he --dela-updates opion, hich ill ene ha all copied file ge p ino bdiecoie in he
deinaion hieach, aaiing he end of he anfe. If o don' hae enogh oom o dplicae all he
aiing file on he deinaion paiion, anohe a o ell nc ha o aen' oel concened abo
dik pace i o e he --partial-dir opion ih a elaie pah; becae hi ell nc ha i i OK o
ah off a cop of a ingle file in a bdi in he deinaion hieach, nc ill e he paial-di a a
aging aea o bing oe he copied file, and hen ename i ino place fom hee. (Specifing a --partial-
dir ih an abole pah doe no hae hi ide-effec.)
-, --fu
Thi opion ell nc ha i hold look fo a bai file fo an deinaion file ha i miing. The cen
algoihm look in he ame dieco a he deinaion file fo eihe a file ha ha an idenical ie and
modified-ime, o a imilal-named file. If fond, nc e he f bai file o o peed p he
anfe.
Noe ha he e of he --delete opion migh ge id of an poenial f-mach file, o eihe e --
delete-after o pecif ome filename eclion if o need o peen hi.
--compare-dest=DIR
Thi opion inc nc o e DI on he deinaion machine a an addiional hieach o compae
deinaion file again doing anfe (if he file ae miing in he deinaion dieco). If a file i fond
in DI ha i idenical o he ende' file, he file ill NOT be anfeed o he deinaion dieco. Thi
i efl fo ceaing a pae backp of j file ha hae changed fom an ealie backp.
Beginning in eion 2.6.4, mliple --compare-dest diecoie ma be poided, hich ill cae nc
o each he li in he ode pecified fo an eac mach. If a mach i fond ha diffe onl in aibe,
a local cop i made and he aibe pdaed. If a mach i no fond, a bai file fom one of he DI
ill be eleced o o peed p he anfe.
If DI i a elaie pah, i i elaie o he deinaion dieco. See alo --cop-dest and --link-dest.
--cop-dest=DIR
Thi opion behae like --compare-dest, b nc ill alo cop nchanged file fond in DI o he
1/10/12 rsnc
29/53 www.samba.org/ftp/rsnc/rsnc.html
deiai diec ig a ca c. Thi i ef f dig afe a e deiai hie eaig
eiig fie iac, ad he dig a fah-ce he a fie hae bee ccef afeed.
Mie --cop-dest diecie a be ided, hich i cae c each he i i he de
ecified f a chaged fie. If a ach i fd, a bai fie f e f he DI i be eeced
eed he afe.
If DI i a eaie ah, i i eaie he deiai diec. See a --compare-dest ad --link-
dest.
--link-dest=DIR
Thi i behae ie --cop-dest, b chaged fie ae had ied f DI he deiai
diec. The fie be ideica i a eeed aibe (e.g. eii, ib ehi) i
de f he fie be ied gehe. A eae:
rsnc -av --link-dest=$PWD/prior_dir host:src_dir/ new_dir/
If fie' ae' iig, dbe-chec hei aibe. A chec if e aibe ae geig fced ide
f c' c, ch a i ha ihe a ige e, a eabe die
ih geeic ehi (ch a OS X' "Ige ehi hi e" i).
Begiig i ei 2.6.4, ie --link-dest diecie a be ided, hich i cae c
each he i i he de ecified f a eac ach. If a ach i fd ha diffe i aibe, a
ca c i ade ad he aibe daed. If a ach i fd, a bai fie f e f he DI
i be eeced eed he afe.
Thi i be he cig i a e deiai hieach, a c ea eiig fie a
defiiie ( i ee i he i-de di he a deiai fie aead ei), ad a aeabe (
i igh chage he aibe f a deiai fie, hich affec a he had-ied ei).
Ne ha if cbie hi i ih --ignore-times, c i i a fie gehe becae i
i ideica fie gehe a a bie f afeig he fie, ee a a addiia chec afe
he fie i daed.
If DI i a eaie ah, i i eaie he deiai diec. See a --compare-dest ad --cop-
dest.
Ne ha c ei i 2.6.1 had a bg ha cd ee --link-dest f ig e
f a -e-e he -o a ecified ( iied b -a). Y ca -ad hi bg b
aidig he -o i he edig a d c.
-, --compress
Wih hi i, c cee he fie daa a i i e he deiai achie, hich edce he
a f daa beig aied -- ehig ha i ef e a ceci.
Ne ha hi i ica achiee bee cei ai ha ca be achieed b ig a
ceig ee he a ceig a becae i ae adaage f he iici ifai
i he achig daa bc ha ae eici e e he ceci.
1/10/12 rsnc
30/53 www.samba.org/ftp/rsnc/rsnc.html
See he --skip-compress i f he defa i f fie ffie ha i be ceed.
--compe-leel=NUM
Eici e he cei ee e (ee --compress) iead f eig i defa. If NUM i -
e, he --compress i i iied.
--kip-compe=LIST
Oeide he i f fie ffie ha i be ceed. The LIST hd be e e fie ffie
(ih he d) eaaed b ahe (/).
Y a ecif a e ig idicae ha fie hd be ied.
Sie chaace-ca achig i ed: each ci f a i f ee iide he ae
bace (e.g. ecia cae, ch a "[:aha:]", ae ed, ad '-' ha ecia eaig).
The chaace aei (*) ad ei-a (?) hae ecia eaig.
Hee' a eae ha ecifie 6 ffie i (ice 1 f he 5 e ache 2 ffie):
--skip-compress=g/jpg/mp[34]/7/b2
The defa i f ffie ha i be ceed i hi (i hi ei f c):
7 avi b2 deb g iso jpeg jpg mov mp3 mp4 ogg rpm tb tg ip
Thi i i be eaced b --skip-compress i i a b e iai: a c f a dae c
i add ied ffie i i f -ceig fie (ad i i a be cfiged a
diffee defa).
--nmeic-id
Wih hi i c i afe eic g ad e ID ahe ha ig e ad g ae
ad aig he a bh ed.
B defa c i e he eae ad gae deeie ha ehi gie fie. The
ecia id 0 ad he ecia g 0 ae ee aed ia e/g ae ee if he --numeric-ids
i i ecified.
If a e g ha ae he ce e i ha ach he deiai e, he he
eic ID f he ce e i ed iead. See a he ce he "e ch" eig i
he cd.cf aage f ifai h he ch eig affec c' abii he
ae f he e ad g ad ha ca d ab i.
--imeo=TIMEOUT
Thi i a e a ai I/O ie i ecd. If daa i afeed f he ecified
ie he c i ei. The defa i 0, hich ea ie.
--conimeo
Thi i a e he a f ie ha c i ai f i ceci a c dae
cceed. If he ie i eached, c ei ih a e.
1/10/12 rsnc
31/53 www.samba.org/ftp/rsnc/rsnc.html
--address
B defa c i bid he idcad adde he cecig a c dae. The --address
i a ecif a ecific IP adde ( hae) bid . See a hi i i he --
daemon de eci.
--port=PORT
Thi ecifie a aeae TCP be e ahe ha he defa f 873. Thi i eeded if
ae ig he dbe-c (::) a cec ih a c dae (ice he URL a ha a
a ecif he a a a f he URL). See a hi i i he --daemon de eci.
--sockopts
Thi i ca ide ede f f ee h ie e hei e he degee. Y
ca e a f ce i hich a ae afe fae ( e!). Read he a age f
he eockop() e ca f deai e f he i a be abe e. B defa
ecia ce i ae e. Thi affec diec ce ceci a ee c dae. Thi
i a ei i he --daemon de eci.
--blocking-io
Thi e c e bcig I/O he achig a ee he a. If he ee he i eihe h
eh, c defa ig bcig I/O, heie i defa ig -bcig I/O. (Ne ha
h efe -bcig I/O.)
-i, --itemie-changes
Ree a ie ieied i f he chage ha ae beig ade each fie, icdig aibe chage.
Thi i eac he ae a ecifig --out-format='%i %n%L'. If eea he i, chaged
fie i a be , b if he eceiig c i a ea ei 2.6.7 ( ca e -vv ih de
ei f c, b ha a he f he ebe eage).
The "%i" ecae ha a cic ha i 11 ee g. The geea fa i ie he ig
YXcstpogua, hee Y i eaced b he e f dae beig de, X i eaced b he fie-e, ad
he he ee eee aibe ha a be if he ae beig dified.
The dae e ha eace he Y ae a f:
A < ea ha a fie i beig afeed he ee h (e).
A > ea ha a fie i beig afeed he ca h (eceied).
A c ea ha a ca chage/ceai i ccig f he ie (ch a he ceai
f a diec he chagig f a i, ec.).
A h ea ha he ie i a had i ahe ie (eie --hard-links).
A . ea ha he ie i beig daed (hgh i igh hae aibe ha ae
beig dified).
A * ea ha he e f he ieied- aea cai a eage (e.g.
"deeig").
The fie-e ha eace he X ae: f f a fie, a d f a diec, a L f a i, a D f a deice,
ad a S f a ecia fie (e.g. aed ce ad fif).
1/10/12 rsnc
32/53 www.samba.org/ftp/rsnc/rsnc.html
The he ee i he ig abe ae he aca ee ha i be if he aciaed aibe f
he ie i beig daed a "." f chage. Thee ecei hi ae: (1) a e ceaed ie
eace each ee ih a "+", (2) a ideica ie eace he d ih ace, ad (3) a
aibe eace each ee ih a "?" (hi ca hae he aig a de c).
The aibe ha i aciaed ih each ee i a f:
A c ea eihe ha a ega fie ha a diffee chec (eie --checksum)
ha a i, deice, ecia fie ha a chaged ae. Ne ha if ae edig
fie a c i 3.0.1, hi chage fag i be ee f chec-
diffeig ega fie.
A s ea he ie f a ega fie i diffee ad i be daed b he fie afe.
A t ea he dificai ie i diffee ad i beig daed he ede' ae
(eie --times). A aeae ae f T ea ha he dificai ie i be e
he afe ie, hich hae he a fie/i/deice i daed ih --
times ad he a i i chaged ad he eceie ca' e i ie. (Ne: he
ig a c 3.0.0 cie, igh ee he s fag cbied ih t iead f he
e T fag f hi ie-eig faie.)
A p ea he eii ae diffee ad ae beig daed he ede' ae
(eie --perms).
A o ea he e i diffee ad i beig daed he ede' ae (eie
--owner ad e-e iiege).
A g ea he g i diffee ad i beig daed he ede' ae (eie --
group ad he ahi e he g).
The u i eeed f fe e.
The a ea ha he ACL ifai chaged.
The x ea ha he eeded aibe ifai chaged.
Oe he i ibe: he deeig fie, he "%i" i he ig "*deeig" f each ie
ha i beig eed (aig ha ae aig a ece egh c ha i g deei iead
f ig he a a ebe eage).
--o-forma=FORMAT
Thi a ecif eac ha he c cie he e a e-dae bai. The
fa i a e ig caiig ebedded ige-chaace ecae eece efied ih a ece (%)
chaace. A defa fa f "%%L" i aed if -v i ecified (hich e he ae f he fie
ad, if he ie i a i, hee i i). F a f i f he ibe ecae chaace, ee he "g
fa" eig i he cd.cf aage.
Secifig he --out-format i i ei each fie, di, ec. ha ge daed i a igifica a (a
afeed fie, a eceaed i/deice, a ched diec). I addii, if he ieie-chage
ecae (%i) i icded i he ig (e.g. if he --itemie-changes i a ed), he ggig f ae
iceae ei a ie ha i chaged i a a (a g a he eceiig ide i a ea 2.6.4).
See he --itemie-changes i f a decii f he f "%i".
Rc i he -fa ig i a fie' afe e e f he afe-aiic ecae i
eeed, i hich cae he ggig i de a he ed f he fie' afe. Whe hi ae ggig i i
1/10/12 rsnc
33/53 www.samba.org/ftp/rsnc/rsnc.html
eIIect and --progress is also speciIied, rsync will also output the name oI the Iile being transIerred prior to
its progress inIormation (Iollowed, oI course, by the out-Iormat output).
--log-file=FILE
This option causes rsync to log what it is doing to a Iile. This is similar to the logging that a daemon does,
but can be requested Ior the client side and/or the server side oI a non-daemon transIer. II speciIied as a
client option, transIer logging will be enabled with a deIault Iormat oI "i nL". See the --log-file-
format option iI you wish to override this.
Here's a example command that requests the remote side to log what is happening:
rsnc -av --rsnc-path="rsnc --log-file=/tmp/rlog" src/ dest/
This is very useIul iI you need to debug why a connection is closing unexpectedly.
--log-file-foma=FORMAT
This allows you to speciIy exactly what per-update logging is put into the Iile speciIied by the --log-file
option (which must also be speciIied Ior this option to have any eIIect). II you speciIy an empty string,
updated Iiles will not be mentioned in the log Iile. For a list oI the possible escape characters, see the "log
Iormat" setting in the rsyncd.conI manpage.
The deIault FORMAT used iI --log-file is speciIied and this option is not is 'i nL'.
--a
This tells rsync to print a verbose set oI statistics on the Iile transIer, allowing you to tell how eIIective
rsync's delta-transIer algorithm is Ior your data.
The current statistics are as Iollows:
Number of files is the count oI all "Iiles" (in the generic sense), which includes
directories, symlinks, etc.
Number of files transferred is the count oI normal Iiles that were updated via
rsync's delta-transIer algorithm, which does not include created dirs, symlinks, etc.
Total file sie is the total sum oI all Iile sizes in the transIer. This does not count any
size Ior directories or special Iiles, but does include the size oI symlinks.
Total transferred file sie is the total sum oI all Iiles sizes Ior just the transIerred
Iiles.
Literal data is how much unmatched Iile-update data we had to send to the receiver
Ior it to recreate the updated Iiles.
Matched data is how much data the receiver got locally when recreating the updated
Iiles.
File list sie is how big the Iile-list data was when the sender sent it to the receiver.
This is smaller than the in-memory size Ior the Iile list due to some compressing oI
duplicated data when rsync sends the list.
File list generation time is the number oI seconds that the sender spent creating the
Iile list. This requires a modern rsync on the sending side Ior this to be present.
File list transfer time is the number oI seconds that the sender spent sending the Iile
1/10/12 rsnc
34/53 www.samba.org/ftp/rsnc/rsnc.html
list to the receiver.
Total btes sent is the count oI all the bytes that rsync sent Irom the client side to the
server side.
Total btes received is the count oI all non-message bytes that rsync received by
the client side Irom the server side. "Non-message" bytes means that we don't count
the bytes Ior a verbose message that the server sent to us, which makes the stats more
consistent.
-8, --8-bi-op
This tells rsync to leave all high-bit characters unescaped in the output instead oI trying to test them to see
iI they're valid in the current locale and escaping the invalid ones. All control characters (but never tabs)
are always escaped, regardless oI this option's setting.
The escape idiom that started in 2.6.7 is to output a literal backslash (\) and a hash (#), Iollowed by
exactly 3 octal digits. For example, a newline would output as "\#012". A literal backslash that is in a
Iilename is not escaped unless it is Iollowed by a hash and 3 digits (0-9).
-h, --hman-readable
Output numbers in a more human-readable Iormat. This makes big numbers output using larger units, with
a K, M, or G suIIix. II this option was speciIied once, these units are K (1000), M (1000*1000), and G
(1000*1000*1000); iI the option is repeated, the units are powers oI 1024 instead oI 1000.
--parial
By deIault, rsync will delete any partially transIerred Iile iI the transIer is interrupted. In some
circumstances it is more desirable to keep partially transIerred Iiles. Using the --partial option tells rsync
to keep the partial Iile which should make a subsequent transIer oI the rest oI the Iile much Iaster.
--parial-dir=DIR
A better way to keep partial Iiles than the --partial option is to speciIy a DI that will be used to hold the
partial data (instead oI writing it out to the destination Iile). On the next transIer, rsync will use a Iile Iound
in this dir as data to speed up the resumption oI the transIer and then delete it aIter it has served its
purpose.
Note that iI --whole-file is speciIied (or implied), any partial-dir Iile that is Iound Ior a Iile that is being
updated will simply be removed (since rsync is sending Iiles without using rsync's delta-transIer algorithm).
Rsync will create the DI iI it is missing (just the last dir -- not the whole path). This makes it easy to use a
relative path (such as "--partial-dir=.rsnc-partial") to have rsync create the partial-directory in the
destination Iile's directory when needed, and then remove it again when the partial Iile is deleted.
II the partial-dir value is not an absolute path, rsync will add an exclude rule at the end oI all your existing
excludes. This will prevent the sending oI any partial-dir Iiles that may exist on the sending side, and will
also prevent the untimely deletion oI partial-dir items on the receiving side. An example: the above --
partial-dir option would add the equivalent oI "-f '-p .rsnc-partial/'" at the end oI any other Iilter rules.
II you are supplying your own exclude rules, you may need to add your own exclude/hide/protect rule Ior
the partial-dir because (1) the auto-added rule may be ineIIective at the end oI your other rules, or (2) you
1/10/12 rsnc
35/53 www.samba.org/ftp/rsnc/rsnc.html
may wish to override rsync's exclude choice. For instance, if you want to make rsync clean-up any left-
over partial-dirs that may be lying around, you should specify --delete-after and add a "risk" filter rule,
e.g. -f 'R .rsnc-partial/'. (Avoid using --delete-before or --delete-during unless you don't need rsync
to use any of the left-over partial-dir data during the current run.)
IMPORTANT: the --partial-dir should not be writable by other users or it is a security risk. E.g. AVOID
"/tmp".
You can also set the partial-dir value the RSYNC_PARTIAL_DIR environment variable. Setting this in
the environment does not force --partial to be enabled, but rather it affects where partial files go when --
partial is specified. For instance, instead of using --partial-dir=.rsnc-tmp along with --progress, you
could set RSYNC_PARTIAL_DIR=.rsync-tmp in your environment and then just use the -P option to
turn on the use of the .rsync-tmp dir for partial transfers. The only times that the --partial option does not
look for this environment value are (1) when --inplace was specified (since --inplace conflicts with --
partial-dir), and (2) when --dela-updates was specified (see below).
For the purposes of the daemon-config's "refuse options" setting, --partial-dir does no imply --partial.
This is so that a refusal of the --partial option can be used to disallow the overwriting of destination files
with a partial transfer, while still allowing the safer idiom provided by --partial-dir.
--dela-updates
This option puts the temporary file from each updated file into a holding directory until the end of the
transfer, at which time all the files are renamed into place in rapid succession. This attempts to make the
updating of the files a little more atomic. By default the files are placed into a directory named ".tmp" in
each file's destination directory, but if you've specified the --partial-dir option, that directory will be used
instead. See the comments in the --partial-dir section for a discussion of how this ".tmp" dir will be
excluded from the transfer, and what you can do if you want rsync to cleanup old ".tmp" dirs that might
be lying around. Conflicts with --inplace and --append.
This option uses more memory on the receiving side (one bit per file transferred) and also requires enough
free disk space on the receiving side to hold an additional copy of all the updated files. Note also that you
should not use an absolute path to --partial-dir unless (1) there is no chance of any of the files in the
transfer having the same name (since all the updated files will be put into a single directory if the path is
absolute) and (2) there are no mount points in the hierarchy (since the delayed updates will fail if they can't
be renamed into place).
See also the "atomic-rsync" perl script in the "support" subdir for an update algorithm that is even more
atomic (it uses --link-dest and a parallel hierarchy of files).
-m, --prune-empt-dirs
This option tells the receiving rsync to get rid of empty directories from the file-list, including nested
directories that have no non-directory children. This is useful for avoiding the creation of a bunch of
useless directories when the sending rsync is recursively scanning a hierarchy of files using
include/exclude/filter rules.
Note that the use of transfer rules, such as the --min-sie option, does not affect what goes into the file
list, and thus does not leave directories empty, even if none of the files in a directory match the transfer
1/10/12 rsnc
36/53 www.samba.org/ftp/rsnc/rsnc.html
e.
Becae he fie-i i aca beig ed, hi i a affec ha diecie ge deeed he a
deee i acie. Hee, ee i id ha ecded fie ad diecie ca ee eiig ie f
beig deeed de a ecde bh hidig ce fie ad ecig deiai fie. See he eihabe
fie-e i f h aid hi.
Y ca ee he ig f ceai e diecie f he fie-i b ig a gba "ec" fie.
F iace, hi i d ee ha he diec "edi" a e i he fie-i:
--fie 'ec edi/'
Hee' a eae ha cie a .df fie i a hieach, ceaig he ecea deiai
diecie hd he .df fie, ad ee ha a ef fie ad diecie i he deiai ae
eed (e he hide fie f -diecie beig ed iead f a ecde):
c -a --de --icde='*.df' -f 'hide,! */' c/ de
If did' a ee ef deiai fie, he e ie-hed i f "--
include='*/' --eclude='*'" d fie i ace f he hide-fie (if ha i e aa ).
--poge
Thi i e c i ifai hig he ge f he afe. Thi gie a bed e
ehig ach. Iie --verbose if i a' aead ecified.
Whie c i afeig a ega fie, i dae a ge ie ha ie hi:
782448 63% 110.64kB/s 0:00:04
I hi eae, he eceie ha ecced 782448 be 63% f he ede' fie, hich i beig
ecced a a ae f 110.64 ibe e ecd, ad he afe i fiih i 4 ecd if he
ce ae i aiaied i he ed.
Thee aiic ca be ieadig if c' dea-afe agih i i e. F eae, if he ede'
fie ci f he bai fie fed b addiia daa, he eed ae i bab d daaica
he he eceie ge he iea daa, ad he afe i bab ae ch ge fiih ha he
eceie eiaed a i a fiihig he ached a f he fie.
Whe he fie afe fiihe, c eace he ge ie ih a a ie ha ie hi:
1238099 100% 146.38kB/s 0:00:08 (fer#5, to-check=169/396)
I hi eae, he fie a 1238099 be g i a, he aeage ae f afe f he he fie a
146.38 ibe e ecd e he 8 ecd ha i cee, i a he 5h afe f a
ega fie dig he ce c ei, ad hee ae 169 e fie f he eceie chec ( ee
if he ae --dae ) eaiig f he 396 a fie i he fie-i.
-P
The -P i i eiae --partial --progress. I e i ae i ch eaie ecif hee
1/10/12 rsnc
37/53 www.samba.org/ftp/rsnc/rsnc.html
two options Ior a long transIer that may be interrupted.
--password-file
This option allows you to provide a password in a Iile Ior accessing an rsync daemon. The Iile must not be
world readable. It should contain just the password as the Iirst line oI the Iile (all other lines are ignored).
This option does not supply a password to a remote shell transport such as ssh; to learn how to do that,
consult the remote shell's documentation. When accessing an rsync daemon using a remote shell as the
transport, this option only comes into eIIect aIter the remote shell Iinishes its authentication (i.e. iI you have
also speciIied a password in the daemon's conIig Iile).
--list-onl
This option will cause the source Iiles to be listed instead oI transIerred. This option is inIerred iI there is a
single source arg and no destination speciIied, so its main uses are: (1) to turn a copy command that
includes a destination arg into a Iile-listing command, or (2) to be able to speciIy more than one source arg
(note: be sure to include the destination). Caution: keep in mind that a source arg with a wild-card is
expanded by the shell into multiple args, so it is never saIe to try to list such an arg without using this
option. For example:
rsnc -av --list-onl foo* dest/
Compatibility note: when requesting a remote listing oI Iiles Irom an rsync that is version 2.6.3 or older,
you may encounter an error iI you ask Ior a non-recursive listing. This is because a Iile listing implies the --
di option w/o --ecie, and older rsyncs don't have that option. To avoid this problem, either
speciIy the --no-di option (iI you don't need to expand a directory's content), or turn on recursion and
exclude the content oI subdirectories: - --eclde='/*/*'.
--bwlimit=KBPS
This option allows you to speciIy a maximum transIer rate in kilobytes per second. This option is most
eIIective when using rsync with large Iiles (several megabytes and up). Due to the nature oI rsync transIers,
blocks oI data are sent, then iI rsync determines the transIer was too Iast, it will wait beIore sending the
next data block. The result is an average transIer rate equaling the speciIied limit. A value oI zero speciIies
no limit.
--write-batch=FILE
Record a Iile that can later be applied to another identical destination with --ead-bach. See the
"BATCH MODE" section Ior details, and also the --onl-ie-bach option.
--onl-write-batch=FILE
Works like --ie-bach, except that no updates are made on the destination system when creating the
batch. This lets you transport the changes to the destination system via some other means and then apply
the changes via --ead-bach.
Note that you can Ieel Iree to write the batch directly to some portable media: iI this media Iills to capacity
beIore the end oI the transIer, you can just apply that partial transIer to the destination and repeat the
whole process to get the rest oI the changes (as long as you don't mind a partially updated destination
system while the multi-update cycle is happening).
1/10/12 rsnc
38/53 www.samba.org/ftp/rsnc/rsnc.html
Alo noe ha o onl ae bandidh hen phing change o a emoe em becae hi allo he
bached daa o be dieed fom he ende ino he bach file iho haing o flo oe he ie o he
eceie (hen plling, he ende i emoe, and h can' ie he bach).
--ead-bach=FILE
Appl all of he change oed in FILE, a file peiol geneaed b --ie-bach. If FIE i -, he
bach daa ill be ead fom andad inp. See he "BATCH MODE" ecion fo deail.
--poocol=NUM
Foce an olde poocol eion o be ed. Thi i efl fo ceaing a bach file ha i compaible ih
an olde eion of nc. Fo inance, if nc 2.6.4 i being ed ih he --ie-bach opion, b
nc 2.6.3 i ha ill be ed o n he --ead-bach opion, o hold e "--poocol=28" hen
ceaing he bach file o foce he olde poocol eion o be ed in he bach file (aming o can'
pgade he nc on he eading em).
--icon=CONVERT_SPEC
Rnc can cone filename beeen chaace e ing hi opion. Uing a CONVERT_SPEC of "."
ell nc o look p he defal chaace-e ia he locale eing. Alenael, o can fll pecif ha
coneion o do b giing a local and a emoe chae epaaed b a comma in he ode --
icon=LOCAL,REMOTE, e.g. --icon=f8,io88591. Thi ode ene ha he opion ill a he
ame hehe o'e phing o plling file. Finall, o can pecif eihe --no-icon o a
CONVERT_SPEC of "-" o n off an coneion. The defal eing of hi opion i ie-pecific, and
can alo be affeced ia he RSYNC_ICONV enionmen aiable.
Fo a li of ha chae name o local icon liba ppo, o can n "icon --li".
If o pecif he --poec-ag opion (-), nc ill anlae he filename o pecif on he
command-line ha ae being en o he emoe ho. See alo he --file-fom opion.
Noe ha nc doe no do an coneion of name in file file (inclding inclde/eclde file). I i p
o o o ene ha o'e pecifing maching le ha can mach on boh ide of he anfe. Fo
inance, o can pecif ea inclde/eclde le if hee ae filename diffeence on he o ide ha
need o be acconed fo.
When o pa an --icon opion o an nc daemon ha allo i, he daemon e he chae pecified
in i "chae" configaion paamee egadle of he emoe chae o acall pa. Th, o ma
feel fee o pecif j he local chae fo a daemon anfe (e.g. --icon=f8).
-4, --ip4 o -6, --ip6
Tell nc o pefe IP4/IP6 hen ceaing ocke. Thi onl affec ocke ha nc ha diec
conol oe, ch a he ogoing ocke hen diecl conacing an nc daemon. See alo hee
opion in he --daemon mode ecion.
If nc a complied iho ppo fo IP6, he --ip6 opion ill hae no effec. The --eion
op ill ell o if hi i he cae.
--checkm-eed=NUM
1/10/12 rsnc
39/53 www.samba.org/ftp/rsnc/rsnc.html
Set the checksum seed to the integer NUM. This 4 byte checksum seed is included in each block and Iile
checksum calculation. By deIault the checksum seed is generated by the server and deIaults to the current
ime() . This option is used to set a speciIic checksum seed, which is useIul Ior applications that want
repeatable block and Iile checksums, or in the case where the user wants a more random checksum seed.
Setting NUM to 0 causes rsync to use the deIault oI ime() Ior checksum seed.
DAEMON OPTIONS
The options allowed when starting an rsync daemon are as Iollows:
--daemon
This tells rsync that it is to run as a daemon. The daemon you start running may be accessed using an
rsync client using the host::module or rsnc://host/module/ syntax.
II standard input is a socket then rsync will assume that it is being run via inetd, otherwise it will detach
Irom the current terminal and become a background daemon. The daemon will read the conIig Iile
(rsyncd.conI) on each connect made by a client and respond to requests accordingly. See the
rsncd.conf(5) man page Ior more details.
--address
By deIault rsync will bind to the wildcard address when run as a daemon with the --daemon option. The -
-address option allows you to speciIy a speciIic IP address (or hostname) to bind to. This makes virtual
hosting possible in conjunction with the --config option. See also the "address" global option in the
rsyncd.conI manpage.
--blimit=KBPS
This option allows you to speciIy a maximum transIer rate in kilobytes per second Ior the data the daemon
sends. The client can still speciIy a smaller --bwlimit value, but their requested value will be rounded down
iI they try to exceed it. See the client version oI this option (above) Ior some extra details.
--config=FILE
This speciIies an alternate conIig Iile than the deIault. This is only relevant when --daemon is speciIied.
The deIault is /etc/rsyncd.conI unless the daemon is running over a remote shell program and the remote
user is not the super-user; in that case the deIault is rsyncd.conI in the current directory (typically
$HOME).
--no-detach
When running as a daemon, this option instructs rsync to not detach itselI and become a background
process. This option is required when running as a service on Cygwin, and may also be useIul when rsync
is supervised by a program such as daemontools or AIX's Sstem Resource Controller. --no-detach
is also recommended when rsync is run under a debugger. This option has no eIIect iI rsync is run Irom
inetd or sshd.
--port=PORT
This speciIies an alternate TCP port number Ior the daemon to listen on rather than the deIault oI 873. See
also the "port" global option in the rsyncd.conI manpage.
1/10/12 rsnc
40/53 www.samba.org/ftp/rsnc/rsnc.html
--log-file=FILE
Thi i e he c dae e he gie g-fie ae iead f ig he "g fie" eig i he
cfig fie.
--log-file-format=FORMAT
Thi i e he c dae e he gie FORMAT ig iead f ig he "g fa"
eig i he cfig fie. I a eabe "afe ggig" e he ig i e, i hich cae afe
ggig i ed ff.
--sockopts
Thi eide he socket options eig i he cd.cf fie ad ha he ae a.
-, --erbose
Thi i iceae he a f ifai he dae g dig i a hae. Afe he cie
cec, he dae' ebi ee i be ced b he i ha he cie ed ad he "a
ebi" eig i he de' cfig eci.
-4, --ip4 or -6, --ip6
Te c efe IP4/IP6 he ceaig he icig ce ha he c dae i e ie
f ceci. Oe f hee i a be eied i de ei f Li ad a IP6
bg i he ee (if ee a "adde aead i e" e he hig ee i ig he ,
ecifig --ip6 --ip4 he aig he dae).
If c a cied ih f IP6, he --ip6 i i hae effec. The --ersion
i e if hi i he cae.
-h, --help
Whe ecified afe --daemon, i a h he age decibig he i aaiabe f aig a
c dae.
FILTER RULES
The fie e a f feibe eeci f hich fie afe (icde) ad hich fie i (ecde). The
e eihe diec ecif icde/ecde ae he ecif a a acie e icde/ecde
ae (e.g. ead he f a fie).
A he i f fie/diecie afe i bi, c chec each ae be afeed agai he i f
icde/ecde ae i , ad he fi achig ae i aced : if i i a ecde ae, he ha fie
i ied; if i i a icde ae he ha fieae i ied; if achig ae i fd, he he
fieae i ied.
Rc bid a deed i f fie e a ecified he cad-ie. Fie e hae he fig a:
RULE [PATTERNORFILENAME]
RULE,MODIFIERS [PATTERNORFILENAME]
Y hae chice f ig eihe h g RULE ae, a decibed be. If e a h-aed
e, he ',' eaaig he RULE f he MODIFIERS i ia. The PATTERN FILENAME ha f
1/10/12 rsnc
41/53 www.samba.org/ftp/rsnc/rsnc.html
(he ee) ce afe eihe a ige ace a dece (_). Hee ae he aaiabe e efie:
eclude, - ecifie a ecde ae.
include, + ecifie a icde ae.
merge, . ecifie a ege-fie ead f e e.
dir-merge, : ecifie a e-diec ege-fie.
hide, H ecifie a ae f hidig fie f he afe.
sho, S fie ha ach he ae ae hidde.
protect, P ecifie a ae f ecig fie f deei.
risk, R fie ha ach he ae ae eced.
clear, ! cea he ce icde/ecde i (ae ag)
Whe e ae beig ead f a fie, e ie ae iged, a ae ce ie ha a ih a "#".
Ne ha he --include/--eclude cad-ie i d a he f age f e aig a decibed
abe -- he a he ecificai f icde/ecde ae a "!" e cea he i (ad he
a ce aig he e ae ead f a fie). If a ae de begi ih "- " (dah, ace) "+
" (, ace), he he e i be ieeed a if "+ " (f a icde i) "- " (f a ecde i)
ee efied he ig. A --filter i, he he had, aa cai eihe a h g e
ae a he a f he e.
Ne a ha he --filter, --include, ad --eclude i ae e e/ae each. T add ie e,
ca eea he i he cad-ie, e he ege-fie a f he --filter i, he --
include-from/--eclude-from i.
INCLUDE/EXCLUDE PATTERN RULES
Y ca icde ad ecde fie b ecifig ae ig he "+", "-", ec. fie e (a idced i he
FILTER RULES eci abe). The icde/ecde e each ecif a ae ha i ached agai he
ae f he fie ha ae gig be afeed. Thee ae ca ae eea f:
if he ae a ih a / he i i ached a aica i he hieach f fie, heie i i
ached agai he ed f he ahae. Thi i iia a eadig ^ i ega eei. Th "/f"
d ach a ae f "f" a eihe he " f he afe" (f a gba e) i he ege-fie'
diec (f a e-diec e). A aified "f" d ach a ae f "f" ahee i he ee
becae he agih i aied ecie f he d; i behae a if each ah ce ge
a a beig he ed f he fieae. Ee he ached "b/f" d ach a a i i he
hieach hee a "f" a fd ihi a diec aed "b". See he eci ANCHORING
INCLUDE/EXCLUDE PATTERNS f a f dici f h ecif a ae ha ache a he
f he afe.
if he ae ed ih a / he i i ach a diec, a ega fie, i, deice.
c che beee dig a ie ig ach ad idcad achig b checig if he ae
cai e f hee hee idcad chaace: '*', '?', ad '[' .
a '*' ache a ah ce, b i a ahe.
e '**' ach ahig, icdig ahe.
a '?' ache a chaace ece a ah (/).
1/10/12 rsnc
42/53 www.samba.org/ftp/rsnc/rsnc.html
a '[' inodce a chaace cla, ch a [a-] o [[:alpha:]].
in a ildcad paen, a backlah can be ed o ecape a ildcad chaace, b i i mached lieall
hen no ildcad ae peen.
if he paen conain a / (no coning a ailing /) o a "**", hen i i mached again he fll pahname,
inclding an leading diecoie. If he paen doen' conain a / o a "**", hen i i mached onl again
he final componen of he filename. (Remembe ha he algoihm i applied eciel o "fll filename"
can acall be an poion of a pah fom he aing dieco on don.)
a ailing "di_name/***" ill mach boh he dieco (a if "di_name/" had been pecified) and
eehing in he dieco (a if "di_name/**" had been pecified). Thi behaio a added in eion
2.6.7.
Noe ha, hen ing he --recursive (-r) opion (hich i implied b -a), ee bcomponen of ee pah i
iied fom he op don, o inclde/eclde paen ge applied eciel o each bcomponen' fll name
(e.g. o inclde "/foo/ba/ba" he bcomponen "/foo" and "/foo/ba" m no be eclded). The eclde
paen acall ho-cici he dieco aeal age hen nc find he file o end. If a paen eclde
a paicla paen dieco, i can ende a deepe inclde paen ineffecal becae nc did no decend
hogh ha eclded ecion of he hieach. Thi i paiclal impoan hen ing a ailing '*' le. Fo
inance, hi on' ok:
+ /some/path/this-file-ill-not-be-found
+ /file-is-included
- *
Thi fail becae he paen dieco "ome" i eclded b he '*' le, o nc nee ii an of he file in
he "ome" o "ome/pah" diecoie. One olion i o ak fo all diecoie in he hieach o be inclded b
ing a ingle le: "+ */" (p i omehee befoe he "- *" le), and pehap e he --prune-empt-dirs
opion. Anohe olion i o add pecific inclde le fo all he paen di ha need o be iied. Fo
inance, hi e of le ok fine:
+ /some/
+ /some/path/
+ /some/path/this-file-is-found
+ /file-also-included
- *
Hee ae ome eample of eclde/inclde maching:
"- *.o" old eclde all name maching *.o
"- /foo" old eclde a file (o dieco) named foo in he anfe-oo dieco
"- foo/" old eclde an dieco named foo
"- /foo/*/ba" old eclde an file named ba hich i a o leel belo a dieco named foo in he
anfe-oo dieco
"- /foo/**/ba" old eclde an file named ba o o moe leel belo a dieco named foo in he
anfe-oo dieco
The combinaion of "+ */", "+ *.c", and "- *" old inclde all diecoie and C oce file b nohing
ele (ee alo he --prune-empt-dirs opion)
The combinaion of "+ foo/", "+ foo/ba.c", and "- *" old inclde onl he foo dieco and foo/ba.c
(he foo dieco m be eplicil inclded o i old be eclded b he "*")
1/10/12 rsnc
43/53 www.samba.org/ftp/rsnc/rsnc.html
The folloing modifie ae acceped afe a "+" o "-":
A / pecifie ha he inclde/eclde le hold be mached again he abole pahname of he cen
iem. Fo eample, "-/ /ec/pad" old eclde he pad file an ime he anfe a ending file
fom he "/ec" dieco, and "-/ bdi/foo" old ala eclde "foo" hen i i in a di named "bdi",
een if "foo" i a he oo of he cen anfe.
A ! pecifie ha he inclde/eclde hold ake effec if he paen fail o mach. Fo inance, "-! */"
old eclde all non-diecoie.
A C i ed o indicae ha all he global CVS-eclde le hold be ineed a eclde in place of he
"-C". No ag hold follo.
An s i ed o indicae ha he le applie o he ending ide. When a le affec he ending ide, i
peen file fom being anfeed. The defal i fo a le o affec boh ide nle --delete-
ecluded a pecified, in hich cae defal le become ende-ide onl. See alo he hide (H) and
ho (S) le, hich ae an alenae a o pecif ending-ide inclde/eclde.
An r i ed o indicae ha he le applie o he eceiing ide. When a le affec he eceiing ide, i
peen file fom being deleed. See he s modifie fo moe info. See alo he poec (P) and ik (R)
le, hich ae an alenae a o pecif eceie-ide inclde/eclde.
A p indicae ha a le i peihable, meaning ha i i ignoed in diecoie ha ae being deleed. Fo
inance, he -C opion' defal le ha eclde hing like "CVS" and "*.o" ae maked a peihable,
and ill no peen a dieco ha a emoed on he oce fom being deleed on he deinaion.
MERGE-FILE FILTER RULES
Yo can mege hole file ino o file le b pecifing eihe a mege (.) o a di-mege (:) file le (a
inodced in he FILTER RULES ecion aboe).
Thee ae o kind of meged file -- ingle-inance ('.') and pe-dieco (':'). A ingle-inance mege file i
ead one ime, and i le ae incopoaed ino he file li in he place of he "." le. Fo pe-dieco mege
file, nc ill can ee dieco ha i aee fo he named file, meging i conen hen he file ei
ino he cen li of inheied le. Thee pe-dieco le file m be ceaed on he ending ide becae i
i he ending ide ha i being canned fo he aailable file o anfe. Thee le file ma alo need o be
anfeed o he eceiing ide if o an hem o affec ha file don' ge deleed (ee PER-DIRECTORY
RULES AND DELETE belo).
Some eample:
merge /etc/rsnc/default.rules
. /etc/rsnc/default.rules
dir-merge .per-dir-filter
dir-merge,n- .non-inherited-per-dir-ecludes
:n- .non-inherited-per-dir-ecludes
The folloing modifie ae acceped afe a mege o di-mege le:
A - pecifie ha he file hold coni of onl eclde paen, ih no ohe le-paing ecep fo in-
file commen.
A + pecifie ha he file hold coni of onl inclde paen, ih no ohe le-paing ecep fo in-
1/10/12 rsnc
44/53 www.samba.org/ftp/rsnc/rsnc.html
file commen.
A C i a a o pecif ha he file hold be ead in a CVS-compaible manne. Thi n on 'n', '',
and '-', b alo allo he li-cleaing oken (!) o be pecified. If no filename i poided, ".cignoe" i
amed.
A e ill eclde he mege-file name fom he anfe; e.g. "di-mege,e .le" i like "di-mege .le"
and "- .le".
An n pecifie ha he le ae no inheied b bdiecoie.
A pecifie ha he le ae od-pli on hiepace inead of he nomal line-pliing. Thi alo n
off commen. Noe: he pace ha epaae he pefi fom he le i eaed peciall, o "- foo + ba"
i paed a o le (aming ha pefi-paing an' alo diabled).
Yo ma alo pecif an of he modifie fo he "+" o "-" le (aboe) in ode o hae he le ha
ae ead in fom he file defal o haing ha modifie e (ecep fo he ! modifie, hich old no be
efl). Fo inance, "mege,-/ .ecl" old ea he conen of .ecl a abole-pah eclde, hile
"di-mege, .fil" and ":C" old each make all hei pe-dieco le appl onl on he ending ide. If
he mege le pecifie ide o affec (ia he s o r modifie o boh), hen he le in he file m no
pecif ide (ia a modifie o a le pefi ch a hide).
Pe-dieco le ae inheied in all bdiecoie of he dieco hee he mege-file a fond nle he
'n' modifie a ed. Each bdieco' le ae pefied o he inheied pe-dieco le fom i paen,
hich gie he nee le a highe pioi han he inheied le. The enie e of di-mege le ae
goped ogehe in he po hee he mege-file a pecified, o i i poible o oeide di-mege le ia a
le ha go pecified ealie in he li of global le. When he li-cleaing le ("!") i ead fom a pe-dieco
file, i onl clea he inheied le fo he cen mege file.
Anohe a o peen a ingle le fom a di-mege file fom being inheied i o ancho i ih a leading lah.
Anchoed le in a pe-dieco mege-file ae elaie o he mege-file' dieco, o a paen "/foo" old
onl mach he file "foo" in he dieco hee he di-mege file file a fond.
Hee' an eample file file hich o'd pecif ia --filter=". file":
merge /home/user/.global-filter
- *.g
dir-merge .rules
+ *.[ch]
- *.o
Thi ill mege he conen of he /home/e/.global-file file a he a of he li and alo n he ".le"
filename ino a pe-dieco file file. All le ead in pio o he a of he dieco can follo he global
anchoing le (i.e. a leading lah mache a he oo of he anfe).
If a pe-dieco mege-file i pecified ih a pah ha i a paen dieco of he fi anfe dieco, nc
ill can all he paen di fom ha aing poin o he anfe dieco fo he indicaed pe-dieco file.
Fo inance, hee i a common file (ee -F):
--filter=': /.rsnc-filter'
Tha le ell nc o can fo he file .nc-file in all diecoie fom he oo don hogh he paen
dieco of he anfe pio o he a of he nomal dieco can of he file in he diecoie ha ae en a
1/10/12 rsnc
45/53 www.samba.org/ftp/rsnc/rsnc.html
a pa of he anfe. (Noe: fo an nc daemon, he oo i ala he ame a he modle' "pah".)
Some eample of hi pe-canning fo pe-dieco file:
rsync -avF /src/path/ /dest/dir
rsync -av --filter=': ../../.rsync-filter' /src/path/ /dest/dir
rsync -av --filter=': .rsync-filter' /src/path/ /dest/dir
The fi o command aboe ill look fo ".nc-file" in "/" and "/c" befoe he nomal can begin looking
fo he file in "/c/pah" and i bdiecoie. The la command aoid he paen-di can and onl look fo
he ".nc-file" file in each dieco ha i a pa of he anfe.
If o an o inclde he conen of a ".cignoe" in o paen, o hold e he le ":C", hich ceae
a di-mege of he .cignoe file, b paed in a CVS-compaible manne. Yo can e hi o affec hee he
--cvs-eclude (-C) opion' inclion of he pe-dieco .cignoe file ge placed ino o le b ping
he ":C" heee o like in o file le. Wiho hi, nc old add he di-mege le fo he .cignoe
file a he end of all o ohe le (giing i a loe pioi han o command-line le). Fo eample:
cat <<EOT rsync -avC --filter='. -' a/ b
+ foo.o
:C
- *.old
EOT
rsync -avC --include=foo.o -f :C --exclude='*.old' a/ b
Boh of he aboe nc command ae idenical. Each one ill mege all he pe-dieco .cignoe le in he
middle of he li ahe han a he end. Thi allo hei di-pecific le o peede he le ha follo he
:C inead of being beien o all o le. To affec he ohe CVS eclde le (i.e. he defal li of
eclion, he conen of $HOME/.cignoe, and he ale of $CVSIGNORE) o hold omi he -C
command-line opion and inead ine a "-C" le ino o file le; e.g. "--filter=-C".
LIST-CLEARING FILTER RULE
Yo can clea he cen inclde/eclde li b ing he "!" file le (a inodced in he FILTER RULES
ecion aboe). The "cen" li i eihe he global li of le (if he le i enconeed hile paing he file
opion) o a e of pe-dieco le (hich ae inheied in hei on b-li, o a bdieco can e hi o
clea o he paen' le).
ANCHORING INCLUDE/EXCLUDE PATTERNS
A menioned ealie, global inclde/eclde paen ae anchoed a he "oo of he anfe" (a oppoed o
pe-dieco paen, hich ae anchoed a he mege-file' dieco). If o hink of he anfe a a bee
of name ha ae being en fom ende o eceie, he anfe-oo i hee he ee a o be dplicaed in
he deinaion dieco. Thi oo goen hee paen ha a ih a / mach.
Becae he maching i elaie o he anfe-oo, changing he ailing lah on a oce pah o changing o
e of he --relative opion affec he pah o need o e in o maching (in addiion o changing ho mch
of he file ee i dplicaed on he deinaion ho). The folloing eample demonae hi.
1/10/12 rsnc
46/53 www.samba.org/ftp/rsnc/rsnc.html
Let's say that we want to match two source Iiles, one with an absolute path oI "/home/me/Ioo/bar", and one with
a path oI "/home/you/bar/baz". Here is how the various command choices diIIer Ior a 2-source transIer:
Example cmd: rsync -a /home/me /home/you /dest
/- pattern: /me/Ioo/bar
/- pattern: /you/bar/baz
Target Iile: /dest/me/Ioo/bar
Target Iile: /dest/you/bar/baz
Example cmd: rsync -a /home/me/ /home/you/ /dest
/- pattern: /Ioo/bar (note missing "me")
/- pattern: /bar/baz (note missing "you")
Target Iile: /dest/Ioo/bar
Target Iile: /dest/bar/baz
Example cmd: rsync -a --relative /home/me/ /home/you /dest
/- pattern: /home/me/Ioo/bar (note Iull path)
/- pattern: /home/you/bar/baz (ditto)
Target Iile: /dest/home/me/Ioo/bar
Target Iile: /dest/home/you/bar/baz
Example cmd: cd /home; rsync -a --relative me/Ioo you/ /dest
/- pattern: /me/Ioo/bar (starts at speciIied path)
/- pattern: /you/bar/baz (ditto)
Target Iile: /dest/me/Ioo/bar
Target Iile: /dest/you/bar/baz
The easiest way to see what name you should Iilter is to just look at the output when using --verbose and put a /
in Iront oI the name (use the --dr-run option iI you're not yet ready to copy any Iiles).
PER-DIRECTORY RULES AND DELETE
Without a delete option, per-directory rules are only relevant on the sending side, so you can Ieel Iree to exclude
the merge Iiles themselves without aIIecting the transIer. To make this easy, the 'e' modiIier adds this exclude Ior
you, as seen in these two equivalent commands:
rsnc -av --filter=': .ecl' --eclude=.ecl host:src/dir /dest
rsnc -av --filter=':e .ecl' host:src/dir /dest
However, iI you want to do a delete on the receiving side AND you want some Iiles to be excluded Irom being
deleted, you'll need to be sure that the receiving side knows what Iiles to exclude. The easiest way is to include
the per-directory merge Iiles in the transIer and use --delete-after, because this ensures that the receiving side
gets all the same exclude rules as the sending side beIore it tries to delete anything:
rsnc -avF --delete-after host:src/dir /dest
However, iI the merge Iiles are not a part oI the transIer, you'll need to either speciIy some global exclude rules
(i.e. speciIied on the command line), or you'll need to maintain your own per-directory merge Iiles on the
1/10/12 rsnc
47/53 www.samba.org/ftp/rsnc/rsnc.html
eceiing ide. An eample of he fi i hi (ame ha he emoe .le file eclde hemele):
nc -a --file=': .le' --file='. /m/ea.le'
--delee ho:c/di /de
In he aboe eample he ea.le file can affec boh ide of he anfe, b (on he ending ide) he le
ae beien o he le meged fom he .le file becae he ee pecified afe he pe-dieco mege
le.
In one final eample, he emoe ide i eclding he .nc-file file fom he anfe, b e an o e o
on .nc-file file o conol ha ge deleed on he eceiing ide. To do hi e m pecificall eclde
he pe-dieco mege file (o ha he don' ge deleed) and hen p le ino he local file o conol ha
ele hold no ge deleed. Like one of hee command:
nc -a --file=':e /.nc-file' --delee \
ho:c/di /de
nc -aFF --delee ho:c/di /de
BACH MODE
Bach mode can be ed o appl he ame e of pdae o man idenical em. Sppoe one ha a ee
hich i eplicaed on a nmbe of ho. No ppoe ome change hae been made o hi oce ee and
hoe change need o be popagaed o he ohe ho. In ode o do hi ing bach mode, nc i n ih
he ie-bach opion o appl he change made o he oce ee o one of he deinaion ee. The ie-
bach opion cae he nc clien o oe in a "bach file" all he infomaion needed o epea hi opeaion
again ohe, idenical deinaion ee.
Geneaing he bach file once ae haing o pefom he file a, checkm, and daa block geneaion moe
han once hen pdaing mliple deinaion ee. Mlica anpo poocol can be ed o anfe he
bach pdae file in paallel o man ho a once, inead of ending he ame daa o ee ho indiidall.
To appl he ecoded change o anohe deinaion ee, n nc ih he ead-bach opion, pecifing he
name of he ame bach file, and he deinaion ee. Rnc pdae he deinaion ee ing he infomaion
oed in he bach file.
Fo o conenience, a cip file i alo ceaed hen he ie-bach opion i ed: i ill be named he ame
a he bach file ih ".h" appended. Thi cip file conain a command-line iable fo pdaing a deinaion
ee ing he aociaed bach file. I can be eeced ing a Bone (o Bone-like) hell, opionall paing in
an alenae deinaion ee pahname hich i hen ed inead of he oiginal deinaion pah. Thi i efl
hen he deinaion ee pah on he cen ho diffe fom he one ed o ceae he bach file.
Eample:
$ nc --ie-bach=foo -a ho:/oce/di/ /ade/di/
$ cp foo* emoe:
$ h emoe ./foo.h /bde/di/
$ nc --ie-bach=foo -a /oce/di/ /ade/di/
$ h emoe nc --ead-bach=- -a /bde/di/ <foo
1/10/12 rsnc
48/53 www.samba.org/ftp/rsnc/rsnc.html
In hee eample, nc i ed o pdae /ade/di/ fom /oce/di/ and he infomaion o epea hi
opeaion i oed in "foo" and "foo.h". The ho "emoe" i hen pdaed ih he bached daa going ino he
dieco /bde/di. The diffeence beeen he o eample eeal ome of he fleibili o hae in ho
o deal ih bache:
The fi eample ho ha he iniial cop doen' hae o be local -- o can ph o pll daa o/fom a
emoe ho ing eihe he emoe-hell na o nc daemon na, a deied.
The fi eample e he ceaed "foo.h" file o ge he igh nc opion hen nning he ead-bach
command on he emoe ho.
The econd eample ead he bach daa ia andad inp o ha he bach file doen' need o be
copied o he emoe machine fi. Thi eample aoid he foo.h cip becae i needed o e a
modified --read-batch opion, b o cold edi he cip file if o ihed o make e of i (j be
e ha no ohe opion i ing o e andad inp, ch a he "--eclude-from=-" opion).
Caea:
The ead-bach opion epec he deinaion ee ha i i pdaing o be idenical o he deinaion ee ha
a ed o ceae he bach pdae filee. When a diffeence beeen he deinaion ee i enconeed he
pdae migh be dicaded ih a aning (if he file appea o be p-o-dae alead) o he file-pdae ma be
aemped and hen, if he file fail o eif, he pdae dicaded ih an eo. Thi mean ha i hold be afe
o e-n a ead-bach opeaion if he command go ineped. If o ih o foce he bached-pdae o
ala be aemped egadle of he file' ie and dae, e he -I opion (hen eading he bach). If an eo
occ, he deinaion ee ill pobabl be in a paiall pdaed ae. In ha cae, nc can be ed in i
egla (non-bach) mode of opeaion o fi p he deinaion ee.
The nc eion ed on all deinaion m be a lea a ne a he one ed o geneae he bach file.
Rnc ill die ih an eo if he poocol eion in he bach file i oo ne fo he bach-eading nc o
handle. See alo he --protocol opion fo a a o hae he ceaing nc geneae a bach file ha an olde
nc can ndeand. (Noe ha bach file changed foma in eion 2.6.3, o miing eion olde han ha
ih nee eion ill no ok.)
When eading a bach file, nc ill foce he ale of ceain opion o mach he daa in he bach file if o
didn' e hem o he ame a he bach-iing command. Ohe opion can (and hold) be changed. Fo
inance --rite-batch change o --read-batch, --files-from i dopped, and he --filter/--include/--eclude
opion ae no needed nle one of he --delete opion i pecified.
The code ha ceae he BATCH.h file anfom an file/inclde/eclde opion ino a ingle li ha i
appended a a "hee" docmen o he hell cip file. An adanced e can e hi o modif he eclde li if
a change in ha ge deleed b --delete i deied. A nomal e can ignoe hi deail and j e he hell
cip a an ea a o n he appopiae --read-batch command fo he bached daa.
The oiginal bach mode in nc a baed on "nc+", b he lae eion e a ne implemenaion.
SYMBOLIC LINKS
Thee baic behaio ae poible hen nc encone a mbolic link in he oce dieco.
1/10/12 rsnc
49/53 www.samba.org/ftp/rsnc/rsnc.html
B defal, mbolic link ae no anfeed a all. A meage "kipping non-egla" file i emied fo an
mlink ha ei.
If --links i pecified, hen mlink ae eceaed ih he ame age on he deinaion. Noe ha --archive
implie --links.
If --cop-links i pecified, hen mlink ae "collaped" b coping hei efeen, ahe han he mlink.
Rnc can alo diingih "afe" and "nafe" mbolic link. An eample hee hi migh be ed i a eb ie
mio ha ihe o ene ha he nc modle ha i copied doe no inclde mbolic link o /etc/passwd
in he pblic ecion of he ie. Uing --cop-unsafe-links ill cae an link o be copied a he file he poin
o on he deinaion. Uing --safe-links ill cae nafe link o be omied alogehe. (Noe ha o m
pecif --links fo --safe-links o hae an effec.)
Smbolic link ae conideed nafe if he ae abole mlink (a ih /), emp, o if he conain enogh
".." componen o acend fom he dieco being copied.
Hee' a mma of ho he mlink opion ae inepeed. The li i in ode of pecedence, o if o
combinaion of opion in' menioned, e he fi line ha i a complee be of o opion:
--cop-links
Tn all mlink ino nomal file (leaing no mlink fo an ohe opion o affec).
--links --cop-unsafe-links
Tn all nafe mlink ino file and dplicae all afe mlink.
--cop-unsafe-links
Tn all nafe mlink ino file, noiil kip all afe mlink.
--links --safe-links
Dplicae afe mlink and kip nafe one.
--links
Dplicae all mlink.
DIAGNOSTICS
nc occaionall podce eo meage ha ma eem a lile cpic. The one ha eem o cae
he mo confion i "poocol eion mimach -- i o hell clean?".
Thi meage i all caed b o ap cip o emoe hell facili podcing naned gabage
on he eam ha nc i ing fo i anpo. The a o diagnoe hi poblem i o n o emoe
hell like hi:
h emoeho /bin/e > o.da
hen look a o.da. If eehing i oking coecl hen o.da hold be a eo lengh file. If o ae
geing he aboe eo fom nc hen o ill pobabl find ha o.da conain ome e o daa.
1/10/12 rsnc
50/53 www.samba.org/ftp/rsnc/rsnc.html
L a he ce ad ha i dcig i. The c cae i icec
cfiged he a ci (ch a .chc .fie) ha cai aee f -
ieacie gi.
If ae haig be debggig fie ae, he ecifig he - i. A hi ee f
ebi c i h h each idiida fie i icded ecded.
EXIT VALUES

Scce

Sa age e

Pc icaibii

E eecig i/ fie, di

Reeed aci ed: a ae a ade aiae 64-bi fie a af ha


ca he; a i a ecified ha i ed b he cie ad b he
ee.

E aig cie-ee c

Dae abe aed g-fie

E i ce I/O

E i fie I/O

E i c c daa ea

E ih ga diagic

E i IPC cde

1/10/12 rsnc
51/53 www.samba.org/ftp/rsnc/rsnc.html
Receied SIGUSR1 SIGINT
21
Se e eed b aitpid()
22
E acaig ce e bffe
23
Paia afe de e
24
Paia afe de aihed ce fie
25
The --a-deee ii ed deei
30
Tie i daa ed/eceie
35
Tie aiig f dae ceci
ENVIRONMENT VARIABLES
CVSIGNORE
The CVSIGNORE eie aiabe ee a ige ae i .cige fie. See
he --cvs-eclude i f e deai.
RSYNCICONV
Secif a defa --iconv eig ig hi eie aiabe. (Fi ed i 3.0.0.)
RSYNCRSH
The RSYNC_RSH eie aiabe a eide he defa he ed a he
a f c. Cad ie i ae eied afe he cad ae, j a i he -e
i.
RSYNCPROXY
The RSYNC_PROXY eie aiabe a ediec c cie e a eb
he cecig a c dae. Y hd e RSYNC_PROXY a hae:
ai.
RSYNCPASSWORD
Seig RSYNC_PASSWORD he eied ad a aheicaed c
ceci a c dae ih e ieei. Ne ha hi de a
ad a ee he a ch a h; ea h d ha, c he ee he'
dceai.
1/10/12 rsnc
52/53 www.samba.org/ftp/rsnc/rsnc.html
SER or LOGNAME
The USER o LOGNAME enionmen aiable ae ed o deemine he defal ename en
o an nc daemon. If neihe i e, he ename defal o "nobod".
HOME
The HOME enionmen aiable i ed o find he e' defal .cignoe file.
FILES
/ec/ncd.conf o ncd.conf
SEE ALSO
rsncd.conf(5)
BUGS
ime ae anfeed a *ni ime_ ale
When anfeing o FAT fileem nc ma e-nc nmodified file. See he commen on he --
modif-window opion.
file pemiion, deice, ec. ae anfeed a naie nmeical ale
ee alo he commen on he --delete opion
Pleae epo bg! See he eb ie a hp://nc.amba.og/
VERSION
Thi man page i cen fo eion 3.0.9 of nc.
INTERNAL OPTIONS
The opion --server and --sender ae ed inenall b nc, and hold nee be ped b a e
nde nomal cicmance. Some aaene of hee opion ma be needed in ceain cenaio, ch
a hen eing p a login ha can onl n an nc command. Fo inance, he ppo dieco of he
nc diibion ha an eample cip named nc (fo eiced nc) ha can be ed ih a
eiced h login.
CREDITS
nc i diibed nde he GNU pblic licene. See he file COPYING fo deail.
A WEB ie i aailable a hp://nc.amba.og/. The ie inclde an FAQ-O-Maic hich ma coe
1/10/12 rsnc
53/53 www.samba.org/ftp/rsnc/rsnc.html
ei aeed b hi aa age.
The ia f ie f c i f://c.aba.g/b/c.
We d be deighed hea f if ie hi ga. Peae cac he aiig-i a
c@i.aba.g.
Thi ga e he ecee ib cei iba ie b Jea- Gai ad Ma Ade.
THANKS
Secia ha g : Jh Va Ee, Ma McCche, Wee W. Tea, Daid Da, J
Bac, Sebaia Kahe, Mai P, ad ge-b--fge cade, J.W. Sch.
Tha a Richad Be, Beda Maca, Bi Waie, Sehe Rhe ad Daid Be. I'e
bab ied e ee, agie if I hae.
AUTHOR
c a igia ie b Ade Tidge ad Pa Macea. Ma ee hae ae cibed
i. I i ce aiaied b Wae Dai.
Maiig i f ad deee ae aaiabe a h://i.aba.g

S-ar putea să vă placă și