xref: /openbsd-src/usr.bin/rsync/rsync.5 (revision 68843726fdfaf2b83595fc0a2e1b026204a30950)
1*68843726Sclaudio.\"	$OpenBSD: rsync.5,v 1.14 2023/04/12 08:32:27 claudio Exp $
260a32ee9Sbenno.\"
360a32ee9Sbenno.\" Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
460a32ee9Sbenno.\"
560a32ee9Sbenno.\" Permission to use, copy, modify, and distribute this software for any
660a32ee9Sbenno.\" purpose with or without fee is hereby granted, provided that the above
760a32ee9Sbenno.\" copyright notice and this permission notice appear in all copies.
860a32ee9Sbenno.\"
960a32ee9Sbenno.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
1060a32ee9Sbenno.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
1160a32ee9Sbenno.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
1260a32ee9Sbenno.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
1360a32ee9Sbenno.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
1460a32ee9Sbenno.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
1560a32ee9Sbenno.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1660a32ee9Sbenno.\"
17*68843726Sclaudio.Dd $Mdocdate: April 12 2023 $
1860a32ee9Sbenno.Dt RSYNC 5
1960a32ee9Sbenno.Os
2060a32ee9Sbenno.Sh NAME
2160a32ee9Sbenno.Nm rsync
2260a32ee9Sbenno.Nd rsync wire protocol
2360a32ee9Sbenno.Sh DESCRIPTION
2460a32ee9SbennoThe
2560a32ee9Sbenno.Nm
2660a32ee9Sbennoprotocol described in this relates to the BSD-licensed
2760a32ee9Sbenno.Xr openrsync 1 ,
2860a32ee9Sbennoa re-implementation of the GPL-licensed reference utility
2960a32ee9Sbenno.Xr rsync 1 .
3060a32ee9SbennoIt is compatible with version 27 of the reference.
3160a32ee9Sbenno.Pp
3260a32ee9SbennoIn this document, the
3360a32ee9Sbenno.Qq client process
3460a32ee9Sbennorefers to the utility as run on the operator's local computer.
3560a32ee9SbennoThe
3660a32ee9Sbenno.Qq server process
3760a32ee9Sbennois run either on the local or remote computer, depending upon the
3860a32ee9Sbennocommand-line given file locations.
3960a32ee9Sbenno.Pp
4060a32ee9SbennoThere are a number of options in the protocol that are dictated by command-line
4160a32ee9Sbennoflags.
4260a32ee9SbennoThese will be noted as
433d9d1c33Sflorian.Fl D
443d9d1c33Sflorianfor devices,
45ea2cd662Sbenno.Fl g
46ea2cd662Sbennofor group ids,
4760a32ee9Sbenno.Fl l
4860a32ee9Sbennofor links,
493d9d1c33Sflorian.Fl n
503d9d1c33Sflorianfor dry-run,
517678960eSflorian.Fl o
527678960eSflorianfor user ids,
5360a32ee9Sbenno.Fl r
5460a32ee9Sbennofor recursion,
5560a32ee9Sbenno.Fl v
5660a32ee9Sbennofor verbose, and
5760a32ee9Sbenno.Fl -delete
5860a32ee9Sbennofor deletion (before).
5960a32ee9Sbenno.Ss Data types
6060a32ee9SbennoThe binary protocol encodes all data in little-endian format.
6160a32ee9SbennoIntegers are signed 32-bit, shorts are signed 16-bit, bytes are unsigned
6260a32ee9Sbenno8-bit.
6360a32ee9SbennoA long is variable-length.
6460a32ee9SbennoFor values less than the maximum integer, the value is transmitted and
6560a32ee9Sbennoread as a 32-bit integer.
6660a32ee9SbennoFor values greater, the value is transmitted first as a maximum integer,
6760a32ee9Sbennothen a 64-bit signed integer.
6860a32ee9Sbenno.Pp
6960a32ee9SbennoThere are three types of checksums: long (slow), short (fast), and
7060a32ee9Sbennowhole-file.
7160a32ee9SbennoThe fast checksum is a derivative of Adler-32.
7260a32ee9SbennoThe slow checksum is MD4,
7360a32ee9Sbennomade over the checksum seed first (serialised in little-endian format),
7460a32ee9Sbennothen the data.
7560a32ee9SbennoThe whole-file applies MD4 to the file first, then the checksum seed at
7660a32ee9Sbennothe end (also serialised in little-endian format).
7760a32ee9Sbenno.Ss Multiplexing
7860a32ee9SbennoMost
7960a32ee9Sbenno.Nm
8060a32ee9Sbennotransmissions are wrapped in a multiplexing envelope protocol.
8160a32ee9SbennoIt is composed as follows:
8260a32ee9Sbenno.Pp
8360a32ee9Sbenno.Bl -enum -compact
8460a32ee9Sbenno.It
8560a32ee9Sbennoenvelope header (4 bytes)
8660a32ee9Sbenno.It
8760a32ee9Sbennoenvelope payload (arbitrary length)
8860a32ee9Sbenno.El
8960a32ee9Sbenno.Pp
9060a32ee9SbennoThe first byte of the envelope header consists of a tag.
9160a32ee9SbennoIf the tag is 7, the payload is normal data.
9260a32ee9SbennoOtherwise, the payload is out-of-band server messages.
9360a32ee9SbennoIf the tag is 1, it is an error on the sender's part and must trigger an
9460a32ee9Sbennoexit.
9560a32ee9SbennoThis limits message payloads to 24 bit integer size,
96*68843726Sclaudio.Li 0x00ffffff .
9760a32ee9Sbenno.Pp
9860a32ee9SbennoThe only data not using this envelope are the initial handshake between
9960a32ee9Sbennoclient and server.
10060a32ee9Sbenno.Ss File list
10160a32ee9SbennoA central part of the protocol is the file list, which is generated by
10260a32ee9Sbennothe sender.
10360a32ee9SbennoIt consists of all files that must be sent to the receiver, either
10460a32ee9Sbennoexplicitly as given or recursively generated.
10560a32ee9Sbenno.Pp
10660a32ee9SbennoThe file list itself consists of filenames and attributes (mode, time,
10760a32ee9Sbennosize, etc.).
10860a32ee9SbennoFilenames must be relative to the destination root and not be absolute
10960a32ee9Sbennoor contain backtracking.
11060a32ee9SbennoSo if a file is given to the sender as
11160a32ee9Sbenno.Pa ../../foo/bar ,
11260a32ee9Sbennoit must be sent as
11360a32ee9Sbenno.Pa foo/bar .
11460a32ee9Sbenno.Pp
11560a32ee9SbennoThe file list should be cleaned of inappropriate files prior to sending.
11660a32ee9SbennoFor example, if
11760a32ee9Sbenno.Fl l
11860a32ee9Sbennois not specified, symbolic links may be omitted.
11960a32ee9SbennoDirectory entries without
12060a32ee9Sbenno.Fl r
12160a32ee9Sbennomay also be omitted.
12260a32ee9SbennoDuplicates may be omitted.
12360a32ee9Sbenno.Pp
12460a32ee9SbennoThe receiver
12560a32ee9Sbenno.Em must not
12660a32ee9Sbennoassume that the file list is clean.
12760a32ee9SbennoIt should not omit inappropriate files from the file list (which would
12860a32ee9Sbennoaffect the indexing), but may omit them during processing.
12960a32ee9Sbenno.Pp
13060a32ee9SbennoPrior to be sent from sender to receiver, and upon being received, the
13160a32ee9Sbennofile list must be lexicographically sorted such as with
13260a32ee9Sbenno.Xr strcmp 3 .
13360a32ee9SbennoSubsequent references to the file are by index in the sorted list.
13460a32ee9Sbenno.Ss Client process
13560a32ee9SbennoThe client can operate in sender or receiver mode depending upon the
13660a32ee9Sbennocommand-line source and destination.
13760a32ee9Sbenno.Pp
13860a32ee9SbennoIf the destination directory (sink) is remote, the client is in sender
13960a32ee9Sbennomode: the client will push its data to the server.
14060a32ee9SbennoIf the source file is remote, it is in receiver mode: the server pushes
14160a32ee9Sbennoto the client.
14260a32ee9SbennoIf neither are remote, the client operates in sender mode.
14360a32ee9SbennoThese are all mutually exclusive.
14460a32ee9Sbenno.Pp
14560a32ee9SbennoWhen the client starts, regardless its mode, it first handshakes the
14660a32ee9Sbennoserver.
14760a32ee9SbennoThis exchange is
14860a32ee9Sbenno.Em not
14960a32ee9Sbennomultiplexed.
15060a32ee9Sbenno.Pp
15160a32ee9Sbenno.Bl -enum -compact
15260a32ee9Sbenno.It
15360a32ee9Sbennosend local version (integer)
15460a32ee9Sbenno.It
15560a32ee9Sbennoreceive remote version (integer)
15660a32ee9Sbenno.It
15760a32ee9Sbennoreceive random seed (integer)
15860a32ee9Sbenno.El
15960a32ee9Sbenno.Pp
16060a32ee9SbennoFollowing this, the client multiplexes when reading from the server.
16160a32ee9SbennoTransmissions sent from client to server are not multiplexed.
16260a32ee9SbennoIt then enters the
16360a32ee9Sbenno.Sx Update exchange
16460a32ee9Sbennoprotocol.
16560a32ee9Sbenno.Ss Server process
16660a32ee9SbennoThe server can operate in sender or receiver mode depending upon how the
16760a32ee9Sbennoclient starts the server.
16860a32ee9SbennoThis may be directly from the parent process (when invoked for local
16960a32ee9Sbennofiles) or indirectly via a remote shell.
17060a32ee9Sbenno.Pp
17160a32ee9SbennoWhen in sender mode, the server pushes data to the client.
17260a32ee9Sbenno(This is equivalent to receiver mode for the client.)
17360a32ee9SbennoIn receiver, the opposite is true.
17460a32ee9Sbenno.Pp
17560a32ee9SbennoWhen the server starts, regardless the mode, it first handshakes the
17660a32ee9Sbennoclient.
17760a32ee9SbennoThis exchange is
17860a32ee9Sbenno.Em not
17960a32ee9Sbennomultiplexed.
18060a32ee9Sbenno.Pp
18160a32ee9Sbenno.Bl -enum -compact
18260a32ee9Sbenno.It
18360a32ee9Sbennosend local version (integer)
18460a32ee9Sbenno.It
18560a32ee9Sbennoreceive remote version (integer)
18660a32ee9Sbenno.It
18760a32ee9Sbennosend random seed (integer)
18860a32ee9Sbenno.El
18960a32ee9Sbenno.Pp
19060a32ee9SbennoFollowing this, the server multiplexes when writing to the client.
19160a32ee9Sbenno(Transmissions received from the client are not multiplexed.)
19260a32ee9SbennoIt then enters the
19360a32ee9Sbenno.Sx Update exchange
19460a32ee9Sbennoprotocol.
19560a32ee9Sbenno.Ss Update exchange
19660a32ee9SbennoWhen the client or server is in sender mode, it begins by conditionally
19760a32ee9Sbennosending the exclusion list.
19860a32ee9SbennoAt this time, this is always empty.
19960a32ee9Sbenno.Pp
20060a32ee9Sbenno.Bl -enum -compact
20160a32ee9Sbenno.It
20260a32ee9Sbennoif
20360a32ee9Sbenno.Fl -delete
20460a32ee9Sbennoand the client, exclusion list zero (integer)
20560a32ee9Sbenno.El
20660a32ee9Sbenno.Pp
20760a32ee9SbennoIt then sends the
20860a32ee9Sbenno.Sx File list .
20960a32ee9SbennoPrior to being sent, the file list should be lexicographically sorted.
21060a32ee9Sbenno.Pp
21160a32ee9Sbenno.Bl -enum -compact
21260a32ee9Sbenno.It
21360a32ee9Sbennostatus byte (integer)
21460a32ee9Sbenno.It
21560a32ee9Sbennoinherited filename length (optional, byte)
21660a32ee9Sbenno.It
21760a32ee9Sbennofilename length (integer or byte)
21860a32ee9Sbenno.It
21960a32ee9Sbennofile (byte array)
22060a32ee9Sbenno.It
22160a32ee9Sbennofile length (long)
22260a32ee9Sbenno.It
22360a32ee9Sbennofile modification time (optional, time_t, integer)
22460a32ee9Sbenno.It
22560a32ee9Sbennofile mode (optional, mode_t, integer)
22660a32ee9Sbenno.It
227ea2cd662Sbennoif
2287678960eSflorian.Fl o ,
2297678960eSflorianthe user id (integer)
2307678960eSflorian.It
2317678960eSflorianif
232ea2cd662Sbenno.Fl g ,
233ea2cd662Sbennothe group id (integer)
234ea2cd662Sbenno.It
2353d9d1c33Sflorianif a special file and
2363d9d1c33Sflorian.Fl D ,
2373d9d1c33Sflorianthe device
2383d9d1c33Sflorian.Dq rdev
2393d9d1c33Sfloriantype (integer)
2403d9d1c33Sflorian.It
24160a32ee9Sbennoif a symbolic link and
24260a32ee9Sbenno.Fl l ,
24360a32ee9Sbennothe link target's length (integer)
24460a32ee9Sbenno.It
24560a32ee9Sbennoif a symbolic link and
24660a32ee9Sbenno.Fl l ,
24760a32ee9Sbennothe link target (byte array)
24860a32ee9Sbenno.El
24960a32ee9Sbenno.Pp
25060a32ee9SbennoThe status byte may consist of the following bits and determines which
25160a32ee9Sbennoof the optional fields are transmitted.
25260a32ee9Sbenno.Pp
25360a32ee9Sbenno.Bl -tag -compact -width Ds
254521a61e9Sbenno.It 0x01
255521a61e9SbennoA top-level directory.
256521a61e9Sbenno(Only applies to directory files.)
257521a61e9SbennoIf specified, the matching local directory is for deletions.
25860a32ee9Sbenno.It 0x02
25960a32ee9SbennoDo not send the file mode: it is a repeat of the last file's mode.
2607678960eSflorian.It 0x08
2617678960eSflorianLike
2627678960eSflorian.Li 0x02 ,
2637678960eSflorianbut for the user id.
264ea2cd662Sbenno.It 0x10
265ea2cd662SbennoLike
266ea2cd662Sbenno.Li 0x02 ,
267ea2cd662Sbennobut for the group id.
26860a32ee9Sbenno.It 0x20
26960a32ee9SbennoInherit some of the prior file name.
27060a32ee9SbennoEnables the inherited filename length transmission.
27160a32ee9Sbenno.It 0x40
27260a32ee9SbennoUse full integer length for file name.
27360a32ee9SbennoOtherwise, use only the byte length.
27460a32ee9Sbenno.It 0x80
27560a32ee9SbennoDo not send the file modification time: it is a repeat of the last
27660a32ee9Sbennofile's.
27760a32ee9Sbenno.El
27860a32ee9Sbenno.Pp
27960a32ee9SbennoIf the status byte is zero, the file-list has terminated.
2807678960eSflorian.Pp
281eb31ce11SbennoIf
2827678960eSflorian.Fl o
2837678960eSflorianhas been specified, the sender sends the list of all users encountered
284e5bf8365Sbennoin the file list.
2857678960eSflorianIdentifier zero
2867678960eSflorian.Pq Qq root
2877678960eSflorianis never transmitted, as it would prematurely end the list.
2881c13accfSbennoThis list may be incomplete or empty: the server is not obligated to
2891c13accfSbennoproperly fill it in with all relevant users.
290eb31ce11Sbenno.Pp
291eb31ce11Sbenno.Bl -enum -compact
292eb31ce11Sbenno.It
2937678960eSflorianuser identifier or zero to indicate end of set (integer)
294eb31ce11Sbenno.It
2957678960eSfloriannon-zero length of user name (byte)
296eb31ce11Sbenno.It
2977678960eSflorianuser name (prior length)
298eb31ce11Sbenno.El
299eb31ce11Sbenno.Pp
3007678960eSflorianThe same sequence is then sent for groups if
3017678960eSflorian.Fl g
3027678960eSflorianhas been specified.
3037678960eSflorian.Pp
30460a32ee9SbennoThe sender then sends any IO error values, which for
30560a32ee9Sbenno.Xr openrsync 1
30660a32ee9Sbennois always zero.
30760a32ee9Sbenno.Pp
30860a32ee9Sbenno.Bl -enum -compact
30960a32ee9Sbenno.It
31060a32ee9Sbennoconstant zero (integer)
31160a32ee9Sbenno.El
31260a32ee9Sbenno.Pp
31360a32ee9SbennoThe server sender then reads the exclusion list, which is always zero.
31460a32ee9Sbenno.Pp
31560a32ee9Sbenno.Bl -enum -compact
31660a32ee9Sbenno.It
31760a32ee9Sbennoif server, constant zero (integer)
31860a32ee9Sbenno.El
31960a32ee9Sbenno.Pp
32060a32ee9SbennoFollowing that, the sender receives data regarding the receiver's copy
32160a32ee9Sbennoof the file list contents.
32260a32ee9SbennoThis data is not ordered in any way.
32360a32ee9SbennoEach of these requests starts as follows:
32460a32ee9Sbenno.Pp
32560a32ee9Sbenno.Bl -enum -compact
32660a32ee9Sbenno.It
32760a32ee9Sbennofile index or -1 to signal a change of phase (integer)
32860a32ee9Sbenno.El
32960a32ee9Sbenno.Pp
33060a32ee9SbennoThe phase starts in phase 1, then proceeds to phase 2, and phase 3
33160a32ee9Sbennosignals an end of transmission (no subsequent blocks).
33260a32ee9SbennoIf a phase change occurs, the sender must write back the -1 constant
33360a32ee9Sbennointeger value and increment its phase state.
33460a32ee9Sbenno.Pp
33560a32ee9SbennoBlocks are read as follows:
33660a32ee9Sbenno.Pp
33760a32ee9Sbenno.Bl -enum -compact
33860a32ee9Sbenno.It
33960a32ee9Sbennoblock index (integer)
34060a32ee9Sbenno.El
34160a32ee9Sbenno.Pp
34260a32ee9SbennoIn
34360a32ee9Sbenno.Pq Fl n
34460a32ee9Sbennomode, the sender may immediately write back the index (integer) to skip
34560a32ee9Sbennothe following.
34660a32ee9Sbenno.Pp
34760a32ee9Sbenno.Bl -enum -compact
34860a32ee9Sbenno.It
34960a32ee9Sbennonumber of blocks (integer)
35060a32ee9Sbenno.It
35160a32ee9Sbennoblock length in the file (integer)
35260a32ee9Sbenno.It
35360a32ee9Sbennolong checksum length (integer)
35460a32ee9Sbenno.It
35560a32ee9Sbennoterminal (remainder) block length (integer)
35660a32ee9Sbenno.El
35760a32ee9Sbenno.Pp
35860a32ee9SbennoAnd for each block:
35960a32ee9Sbenno.Pp
36060a32ee9Sbenno.Bl -enum -compact
36160a32ee9Sbenno.It
36260a32ee9Sbennoshort checksum (integer)
36360a32ee9Sbenno.It
36460a32ee9Sbennolong checksum (bytes of checksum length)
36560a32ee9Sbenno.El
36660a32ee9Sbenno.Pp
36760a32ee9SbennoThe client then compares the two files, block by block, and updates the
36860a32ee9Sbennoserver with mismatches as follows.
36960a32ee9Sbenno.Pp
37060a32ee9Sbenno.Bl -enum -compact
37160a32ee9Sbenno.It
37260a32ee9Sbennofile index (integer)
37360a32ee9Sbenno.It
37460a32ee9Sbennonumber of blocks (integer)
37560a32ee9Sbenno.It
37660a32ee9Sbennoblock length (integer)
37760a32ee9Sbenno.It
37860a32ee9Sbennolong checksum length (integer)
37960a32ee9Sbenno.It
38060a32ee9Sbennoremainder block length (integer)
38160a32ee9Sbenno.El
38260a32ee9Sbenno.Pp
38360a32ee9SbennoThen for each block:
38460a32ee9Sbenno.Pp
38560a32ee9Sbenno.Bl -enum -compact
38660a32ee9Sbenno.It
38760a32ee9Sbennodata chunk size (integer)
38860a32ee9Sbenno.It
38960a32ee9Sbennodata chunk (bytes)
39060a32ee9Sbenno.It
39160a32ee9Sbennoblock index subsequent to chunk or zero for finished (integer)
39260a32ee9Sbenno.El
39360a32ee9Sbenno.Pp
394ab0e7209SjsgFollowing this sequence, the sender sends the following:
39560a32ee9Sbenno.Pp
39660a32ee9Sbenno.Bl -enum -compact
39760a32ee9Sbenno.It
39860a32ee9Sbennowhole-file long checksum (16 bytes)
39960a32ee9Sbenno.El
40060a32ee9Sbenno.Pp
40160a32ee9SbennoThe sender then either handles the next queued file or, if the receiver
40260a32ee9Sbennohas written a phase change, the phase change step.
40360a32ee9Sbenno.Pp
40460a32ee9SbennoIf the sender is the server and
40560a32ee9Sbenno.Fl v
40660a32ee9Sbennohas been specified, the sender must send statistics.
40760a32ee9Sbenno.Pp
40860a32ee9Sbenno.Bl -enum -compact
40960a32ee9Sbenno.It
41060a32ee9Sbennototal bytes read (long)
41160a32ee9Sbenno.It
41260a32ee9Sbennototal bytes written (long)
41360a32ee9Sbenno.It
41460a32ee9Sbennototal size of files (long)
41560a32ee9Sbenno.El
41660a32ee9Sbenno.Pp
41760a32ee9SbennoFinally, the sender must read a final constant-value integer.
41860a32ee9Sbenno.Pp
41960a32ee9Sbenno.Bl -enum -compact
42060a32ee9Sbenno.It
42160a32ee9Sbennoend-of-sequence -1 value (integer)
42260a32ee9Sbenno.El
42360a32ee9Sbenno.Pp
42460a32ee9SbennoIf in receiver mode, the inverse above (write instead of read, read
42560a32ee9Sbennoinstead of write) is performed.
42660a32ee9Sbenno.Pp
42760a32ee9SbennoThe receiver begins by conditionally writing, then reading, the
42860a32ee9Sbennoexclusion list count, which is always zero.
42960a32ee9Sbenno.Pp
43060a32ee9Sbenno.Bl -enum -compact
43160a32ee9Sbenno.It
43260a32ee9Sbennoif client, send zero (integer)
43360a32ee9Sbenno.It
43460a32ee9Sbennoif receiver and
43560a32ee9Sbenno.Fl -delete ,
43660a32ee9Sbennoread zero (integer)
43760a32ee9Sbenno.El
43860a32ee9Sbenno.Pp
43960a32ee9SbennoThe receiver then proceeds with reading the
44060a32ee9Sbenno.Sx File list
44160a32ee9Sbennoas already
44260a32ee9Sbennodefined.
44360a32ee9SbennoFollowing the list, the receiver reads the IO error, which must be zero.
44460a32ee9Sbenno.Pp
44560a32ee9Sbenno.Bl -enum -compact
44660a32ee9Sbenno.It
44760a32ee9Sbennoconstant zero (integer)
44860a32ee9Sbenno.El
44960a32ee9Sbenno.Pp
45060a32ee9SbennoThe receiver must then sort the file names lexicographically.
45160a32ee9Sbenno.Pp
45260a32ee9SbennoIf there are no files in the file list at this time, the receiver must
45360a32ee9Sbennoexit prior to sending per-file data.
45460a32ee9SbennoIt then proceeds with the file blocks.
45560a32ee9Sbenno.Pp
45660a32ee9SbennoFor file blocks, the receiver must look at each file that is not up to
45760a32ee9Sbennodate, defined by having the same file size and timestamp, and send it to
45860a32ee9Sbennothe server.
45960a32ee9SbennoSymbolic links and directory entries are never sent to the server.
46060a32ee9Sbenno.Pp
46160a32ee9SbennoAfter the second phase has completed and prior to writing the
46260a32ee9Sbennoend-of-data signal, the client receiver reads statistics.
46360a32ee9SbennoThis is only performed with
46460a32ee9Sbenno.Pq Fl v .
46560a32ee9Sbenno.Pp
46660a32ee9Sbenno.Bl -enum -compact
46760a32ee9Sbenno.It
46860a32ee9Sbennototal bytes read (long)
46960a32ee9Sbenno.It
47060a32ee9Sbennototal bytes written (long)
47160a32ee9Sbenno.It
47260a32ee9Sbennototal size of files (long)
47360a32ee9Sbenno.El
47460a32ee9Sbenno.Pp
47560a32ee9SbennoFinally, the receiver must send the constant end-of-sequence marker.
47660a32ee9Sbenno.Pp
47760a32ee9Sbenno.Bl -enum -compact
47860a32ee9Sbenno.It
47960a32ee9Sbennoend-of-sequence -1 value (integer)
48060a32ee9Sbenno.El
48160a32ee9Sbenno.Ss Sender and receiver asynchrony
48260a32ee9SbennoThe sender and receiver need not work in lockstep.
48360a32ee9SbennoThe receiver may send file update requests as quickly as it parses them,
48460a32ee9Sbennoand respond to the sender's update notices on demand.
48560a32ee9SbennoSimilarly, the sender may read as many update requests as it can, and
48660a32ee9Sbennoservice them in any order it wishes.
48760a32ee9Sbenno.Pp
48860a32ee9SbennoThe sender and receiver synchronise state only at the end of phase.
48960a32ee9Sbenno.Pp
49060a32ee9SbennoThe reference
49160a32ee9Sbenno.Xr rsync 1
49260a32ee9Sbennotakes advantage of this with a two-process receiver, one for sending
49360a32ee9Sbennoupdate requests (the generator) and another for receiving.
49460a32ee9Sbenno.Xr openrsync 1
49560a32ee9Sbennouses an event-loop model instead.
49660a32ee9Sbenno.\" .Sh CONTEXT
49760a32ee9Sbenno.\" For section 9 functions only.
49860a32ee9Sbenno.\" .Sh RETURN VALUES
49960a32ee9Sbenno.\" For sections 2, 3, and 9 function return values only.
50060a32ee9Sbenno.\" .Sh ENVIRONMENT
50160a32ee9Sbenno.\" For sections 1, 6, 7, and 8 only.
50260a32ee9Sbenno.\" .Sh FILES
50360a32ee9Sbenno.\" .Sh EXIT STATUS
50460a32ee9Sbenno.\" For sections 1, 6, and 8 only.
50560a32ee9Sbenno.\" .Sh EXAMPLES
50660a32ee9Sbenno.\" .Sh DIAGNOSTICS
50760a32ee9Sbenno.\" For sections 1, 4, 6, 7, 8, and 9 printf/stderr messages only.
50860a32ee9Sbenno.\" .Sh ERRORS
50960a32ee9Sbenno.\" For sections 2, 3, 4, and 9 errno settings only.
51060a32ee9Sbenno.Sh SEE ALSO
51160a32ee9Sbenno.Xr openrsync 1 ,
51260a32ee9Sbenno.Xr rsync 1 ,
51360a32ee9Sbenno.Xr rsyncd 5
51460a32ee9Sbenno.\" .Sh STANDARDS
51560a32ee9Sbenno.\" .Sh HISTORY
51660a32ee9Sbenno.\" .Sh AUTHORS
51760a32ee9Sbenno.\" .Sh CAVEATS
51860a32ee9Sbenno.Sh BUGS
51960a32ee9SbennoTime values are sent as 32-bit integers.
52060a32ee9Sbenno.Pp
52160a32ee9SbennoWhen in server mode
52260a32ee9Sbenno.Em and
52360a32ee9Sbennowhen communicating to a client with a newer protocol (>27), the phase
52460a32ee9Sbennochange integer (-1) acknowledgement must be sent twice by the sender.
52560a32ee9SbennoThe is probably a bug in the reference implementation.
526