source: networking/netprogs/rsync.xml@ adfe27c

ken/TL2024 trunk
Last change on this file since adfe27c was 99c90fa, checked in by Douglas R. Reno <renodr@…>, 2 months ago

Lots of tags

  • Property mode set to 100644
File size: 10.5 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
6
7 <!ENTITY rsync-download-http "https://www.samba.org/ftp/rsync/src/rsync-&rsync-version;.tar.gz">
8 <!ENTITY rsync-download-ftp " ">
9 <!ENTITY rsync-md5sum "f216f350ef56b9ba61bc313cb6ec2ed6">
10 <!ENTITY rsync-size "1.1 MB">
11 <!ENTITY rsync-buildsize "9.6 MB (with tests; add 24 MB for HTML API documentation)">
12 <!ENTITY rsync-time "0.7 SBU (with tests)">
13]>
14
15<sect1 id="rsync" xreflabel="rsync-&rsync-version;">
16 <?dbhtml filename="rsync.html"?>
17
18
19 <title>rsync-&rsync-version;</title>
20
21 <indexterm zone="rsync">
22 <primary sortas="a-rsync">rsync</primary>
23 </indexterm>
24
25 <sect2 role="package">
26 <title>Introduction to rsync</title>
27
28 <para>
29 The <application>rsync</application> package contains the
30 <command>rsync</command> utility. This is useful for synchronizing large
31 file archives over a network.
32 </para>
33
34 &lfs121_checked;
35
36 <bridgehead renderas="sect3">Package Information</bridgehead>
37 <itemizedlist spacing="compact">
38 <listitem>
39 <para>
40 Download (HTTP): <ulink url="&rsync-download-http;"/>
41 </para>
42 </listitem>
43 <listitem>
44 <para>
45 Download (FTP): <ulink url="&rsync-download-ftp;"/>
46 </para>
47 </listitem>
48 <listitem>
49 <para>
50 Download MD5 sum: &rsync-md5sum;
51 </para>
52 </listitem>
53 <listitem>
54 <para>
55 Download size: &rsync-size;
56 </para>
57 </listitem>
58 <listitem>
59 <para>
60 Estimated disk space required: &rsync-buildsize;
61 </para>
62 </listitem>
63 <listitem>
64 <para>
65 Estimated build time: &rsync-time;
66 </para>
67 </listitem>
68 </itemizedlist>
69
70 <bridgehead renderas="sect3">rsync Dependencies</bridgehead>
71
72 <!-- This does now use OpenSSL and zstd from LFS. -->
73 <bridgehead renderas="sect4">Recommended</bridgehead>
74 <para role="recommended">
75 <xref linkend="popt"/>
76 </para>
77
78 <bridgehead renderas="sect4">Optional</bridgehead>
79 <para role="optional">
80 <xref linkend="doxygen"/>,
81 <ulink url="https://lz4.github.io/lz4/">lz4</ulink>, and
82 <ulink url="https://cyan4973.github.io/xxHash/">xxhash</ulink>
83 </para>
84
85 </sect2>
86
87 <sect2 role="installation">
88 <title>Installation of rsync</title>
89
90 <para>
91 For security reasons, running the <application>rsync</application>
92 server as an unprivileged user and group is encouraged. If you intend to
93 run <command>rsync</command> as a daemon, create the
94 <systemitem class="username">rsyncd</systemitem> user and group
95 with the following commands issued by the
96 <systemitem class="username">root</systemitem> user:
97 </para>
98
99<screen role="root"><userinput>groupadd -g 48 rsyncd &amp;&amp;
100useradd -c "rsyncd Daemon" -m -d /home/rsync -g rsyncd \
101 -s /bin/false -u 48 rsyncd</userinput></screen>
102
103 <para>
104 Install <application>rsync</application> by running the following
105 commands:
106 </para>
107
108<screen><userinput>./configure --prefix=/usr \
109 --disable-lz4 \
110 --disable-xxhash \
111 --without-included-zlib &amp;&amp;
112make</userinput></screen>
113
114 <para>
115 If you have <xref linkend="doxygen"/> installed and wish to
116 build HTML API documentation, issue:
117 </para>
118
119<screen remap="doc"><userinput>doxygen</userinput></screen>
120
121 <para>
122 To test the results, issue: <command>make check</command>.
123 </para>
124
125 <para>
126 Now, as the <systemitem class="username">root</systemitem> user:
127 </para>
128
129<screen role='root'><userinput>make install</userinput></screen>
130
131 <para>
132 If you built the documentation, install it using the following
133 commands as the <systemitem class="username">root</systemitem> user:
134 </para>
135
136<screen role='root'
137 remap="doc"><userinput>install -v -m755 -d /usr/share/doc/rsync-&rsync-version;/api &amp;&amp;
138install -v -m644 dox/html/* /usr/share/doc/rsync-&rsync-version;/api</userinput></screen>
139
140 </sect2>
141
142 <sect2 role="commands">
143 <title>Command Explanations</title>
144
145 <para>
146 <parameter>--disable-lz4</parameter>: This switch disables LZ4 compression
147 support. Note that it uses the superior 'zstd' algorithm when this switch
148 is in use, and zstd is provided in LFS.
149 </para>
150
151 <para>
152 <parameter>--disable-xxhash</parameter>: This switch disables advanced
153 xxhash checksum support. Remove this switch if you have installed
154 <ulink url="https://cyan4973.github.io/xxHash/">xxhash</ulink>.
155 </para>
156
157 <para>
158 <parameter>--without-included-zlib</parameter>: This switch enables
159 compilation with the system-installed zlib library.
160 </para>
161
162 </sect2>
163
164 <sect2 role="configuration">
165 <title>Configuring rsync</title>
166
167 <sect3 id="rsync-config">
168 <title>Config Files</title>
169
170 <para>
171 <filename>/etc/rsyncd.conf</filename>
172 </para>
173
174 <indexterm zone="rsync rsync-config">
175 <primary sortas="e-etc-rsyncd.conf">/etc/rsyncd.conf</primary>
176 </indexterm>
177
178 </sect3>
179
180 <sect3>
181 <title>Configuration Information</title>
182
183 <para>
184 For client access to remote files, you may need to install the
185 <xref linkend="openssh"/> package to connect to the remote server.
186 </para>
187
188 <para>
189 This is a simple download-only configuration to set up running
190 <command>rsync</command> as a server. See the <ulink role='man'
191 url='&man;rsyncd.conf.5'>rsyncd.conf(5)</ulink>
192 man-page for additional options (i.e., user authentication).
193 </para>
194
195<screen role="root"><userinput>cat &gt; /etc/rsyncd.conf &lt;&lt; "EOF"
196<literal># This is a basic rsync configuration file
197# It exports a single module without user authentication.
198
199motd file = /home/rsync/welcome.msg
200use chroot = yes
201
202[localhost]
203 path = /home/rsync
204 comment = Default rsync module
205 read only = yes
206 list = yes
207 uid = rsyncd
208 gid = rsyncd
209</literal>
210EOF</userinput></screen>
211
212 <para>
213 You can find additional configuration information and general
214 documentation about <command>rsync</command> at
215 <ulink url="https://rsync.samba.org/documentation.html"/>.
216 </para>
217
218 </sect3>
219
220 <sect3 id="rsync-init">
221 <title><phrase revision="sysv">Boot Script</phrase>
222 <phrase revision="systemd">Systemd Unit</phrase></title>
223
224 <para>
225 Note that you only need to start the
226 <application>rsync</application> server if you want to provide an
227 <application>rsync</application> archive on your local machine.
228 You don't need this <phrase revision="sysv">script</phrase>
229 <phrase revision="systemd">unit</phrase> to run the
230 <application>rsync</application> client.
231 </para>
232
233 <para>
234 Install the
235 <phrase revision="sysv"><filename>/etc/rc.d/init.d/rsyncd</filename>
236 init script</phrase>
237 <phrase revision="systemd"><filename>rsyncd.service</filename>
238 unit</phrase> included in the
239 <xref linkend="bootscripts" revision="sysv"/>
240 <xref linkend="systemd-units" revision="systemd"/> package.
241 </para>
242
243<screen role="root"><userinput>make install-rsyncd</userinput></screen>
244
245 <note revision="systemd">
246 <para>
247 This package comes with two types of units: A service file and a
248 socket file. The service file will start rsync daemon once at boot
249 and it will keep running until the system shuts down. The socket file
250 will make systemd listen on rsync port (Default 873, needs to be
251 edited for anything else) and will start rsync daemon when something
252 tries to connect to that port and stop the daemon when the connection
253 is terminated. This is called socket activation and is analogous to
254 using <application>{,x}inetd</application> on a SysVinit based
255 system.
256 </para>
257
258 <para>
259 By default, the first method is used - rsync daemon is started
260 at boot and stopped at shutdown. If the socket method is desired, you
261 need to run as the
262 <systemitem class="username">root</systemitem> user:
263 </para>
264
265<screen role="nodump"><userinput>systemctl stop rsyncd &amp;&amp;
266systemctl disable rsyncd &amp;&amp;
267systemctl enable rsyncd.socket &amp;&amp;
268systemctl start rsyncd.socket</userinput></screen>
269
270 <para>
271 Note that socket method is only useful for remote backups. For
272 local backups you'll need the service method.
273 </para>
274 </note>
275
276 </sect3>
277
278 </sect2>
279
280 <sect2 role="content">
281 <title>Contents</title>
282
283 <segmentedlist>
284 <segtitle>Installed Program</segtitle>
285 <segtitle>Installed Libraries</segtitle>
286 <segtitle>Installed Directories</segtitle>
287
288 <seglistitem>
289 <seg>rsync and rsync-ssl</seg>
290 <seg>None</seg>
291 <seg>Optionally, /usr/share/doc/rsync-&rsync-version;</seg>
292 </seglistitem>
293 </segmentedlist>
294
295 <variablelist>
296 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
297 <?dbfo list-presentation="list"?>
298 <?dbhtml list-presentation="table"?>
299
300 <varlistentry id="rsync-prog">
301 <term><command>rsync</command></term>
302 <listitem>
303 <para>
304 is a replacement for <command>rcp</command> (and
305 <command>scp</command>) that has many more features. It uses the
306 <quote>rsync algorithm</quote> which provides a very fast method of
307 syncing remote files. It does this by sending just the differences
308 in the files across the link, without requiring that both sets of
309 files are present at one end of the link beforehand
310 </para>
311 <indexterm zone="rsync rsync-prog">
312 <primary sortas="b-rsync">rsync</primary>
313 </indexterm>
314 </listitem>
315 </varlistentry>
316
317 <varlistentry id="rsync-ssl">
318 <term><command>rsync-ssl</command></term>
319 <listitem>
320 <para>
321 is a helper script used when connecting to an rsync daemon that
322 has SSL support built in
323 </para>
324 <indexterm zone="rsync rsync-ssl">
325 <primary sortas="b-rsync-ssl">rsync-ssl</primary>
326 </indexterm>
327 </listitem>
328 </varlistentry>
329
330 </variablelist>
331
332 </sect2>
333
334</sect1>
Note: See TracBrowser for help on using the repository browser.