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