[0931098] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
[6732c094] | 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
[0931098] | 4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 |
|
---|
[1c73261] | 7 | <!ENTITY rsync-download-http "https://www.samba.org/ftp/rsync/src/rsync-&rsync-version;.tar.gz">
|
---|
| 8 | <!ENTITY rsync-download-ftp " ">
|
---|
[a2d379c] | 9 | <!ENTITY rsync-md5sum "209f8326f5137d8817a6276d9577a2f1">
|
---|
[f0f68c1] | 10 | <!ENTITY rsync-size "1.0 MB">
|
---|
[a2d379c] | 11 | <!ENTITY rsync-buildsize "10 MB (with tests - additional 47 MB for HTML API documentation)">
|
---|
[f0f68c1] | 12 | <!ENTITY rsync-time "0.7 SBU (with tests)">
|
---|
[0931098] | 13 | ]>
|
---|
| 14 |
|
---|
[46cef72] | 15 | <sect1 id="rsync" xreflabel="rsync-&rsync-version;">
|
---|
[5ab6e72] | 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 |
|
---|
[b51fe6e] | 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>
|
---|
[5ab6e72] | 36 |
|
---|
[3166e3c] | 37 | &lfs110a_checked;
|
---|
[20e6cade] | 38 |
|
---|
[5ab6e72] | 39 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
| 40 | <itemizedlist spacing="compact">
|
---|
| 41 | <listitem>
|
---|
[b51fe6e] | 42 | <para>
|
---|
| 43 | Download (HTTP): <ulink url="&rsync-download-http;"/>
|
---|
| 44 | </para>
|
---|
[5ab6e72] | 45 | </listitem>
|
---|
| 46 | <listitem>
|
---|
[b51fe6e] | 47 | <para>
|
---|
| 48 | Download (FTP): <ulink url="&rsync-download-ftp;"/>
|
---|
| 49 | </para>
|
---|
[5ab6e72] | 50 | </listitem>
|
---|
| 51 | <listitem>
|
---|
[b51fe6e] | 52 | <para>
|
---|
| 53 | Download MD5 sum: &rsync-md5sum;
|
---|
| 54 | </para>
|
---|
[5ab6e72] | 55 | </listitem>
|
---|
| 56 | <listitem>
|
---|
[b51fe6e] | 57 | <para>
|
---|
| 58 | Download size: &rsync-size;
|
---|
| 59 | </para>
|
---|
[5ab6e72] | 60 | </listitem>
|
---|
| 61 | <listitem>
|
---|
[b51fe6e] | 62 | <para>
|
---|
| 63 | Estimated disk space required: &rsync-buildsize;
|
---|
| 64 | </para>
|
---|
[5ab6e72] | 65 | </listitem>
|
---|
| 66 | <listitem>
|
---|
[b51fe6e] | 67 | <para>
|
---|
| 68 | Estimated build time: &rsync-time;
|
---|
| 69 | </para>
|
---|
[5ab6e72] | 70 | </listitem>
|
---|
| 71 | </itemizedlist>
|
---|
| 72 |
|
---|
| 73 | <bridgehead renderas="sect3">rsync Dependencies</bridgehead>
|
---|
| 74 |
|
---|
[f0f68c1] | 75 | <!-- This does now use OpenSSL and zstd from LFS. -->
|
---|
[b802f15] | 76 | <bridgehead renderas="sect4">Recommended</bridgehead>
|
---|
| 77 | <para role="recommended">
|
---|
| 78 | <xref linkend="popt"/>
|
---|
| 79 | </para>
|
---|
| 80 |
|
---|
[f0f68c1] | 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 |
|
---|
[3cb0c57] | 88 | <para condition="html" role="usernotes">User Notes:
|
---|
| 89 | <ulink url="&blfs-wiki;/rsync"/></para>
|
---|
| 90 |
|
---|
[5ab6e72] | 91 | </sect2>
|
---|
| 92 |
|
---|
| 93 | <sect2 role="installation">
|
---|
| 94 | <title>Installation of rsync</title>
|
---|
| 95 |
|
---|
[b51fe6e] | 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>
|
---|
[5ab6e72] | 104 |
|
---|
[fdf798a6] | 105 | <screen role="root"><userinput>groupadd -g 48 rsyncd &&
|
---|
[0c8e745] | 106 | useradd -c "rsyncd Daemon" -m -d /home/rsync -g rsyncd \
|
---|
[fdf798a6] | 107 | -s /bin/false -u 48 rsyncd</userinput></screen>
|
---|
[5ab6e72] | 108 |
|
---|
[b51fe6e] | 109 | <para>
|
---|
| 110 | Install <application>rsync</application> by running the following
|
---|
| 111 | commands:
|
---|
| 112 | </para>
|
---|
[5ab6e72] | 113 |
|
---|
[f0f68c1] | 114 | <screen><userinput>./configure --prefix=/usr \
|
---|
| 115 | --disable-lz4 \
|
---|
| 116 | --disable-xxhash \
|
---|
| 117 | --without-included-zlib &&
|
---|
[fdf798a6] | 118 | make</userinput></screen>
|
---|
| 119 |
|
---|
[b51fe6e] | 120 | <para>
|
---|
| 121 | If you have <xref linkend="doxygen"/> installed and wish to
|
---|
| 122 | build HTML API documentation, issue:
|
---|
| 123 | </para>
|
---|
[a42c273] | 124 |
|
---|
| 125 | <screen remap="doc"><userinput>doxygen</userinput></screen>
|
---|
[9b7fb82] | 126 |
|
---|
[b51fe6e] | 127 | <para>
|
---|
| 128 | To test the results, issue: <command>make check</command>.
|
---|
| 129 | </para>
|
---|
[fdf798a6] | 130 |
|
---|
[b51fe6e] | 131 | <para>
|
---|
| 132 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
| 133 | </para>
|
---|
[fdf798a6] | 134 |
|
---|
| 135 | <screen role='root'><userinput>make install</userinput></screen>
|
---|
| 136 |
|
---|
[b51fe6e] | 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>
|
---|
[fdf798a6] | 141 |
|
---|
[a42c273] | 142 | <screen role='root'
|
---|
| 143 | remap="doc"><userinput>install -v -m755 -d /usr/share/doc/rsync-&rsync-version;/api &&
|
---|
[3534db5d] | 144 | install -v -m644 dox/html/* /usr/share/doc/rsync-&rsync-version;/api</userinput></screen>
|
---|
[0931098] | 145 |
|
---|
[5ab6e72] | 146 | </sect2>
|
---|
[0931098] | 147 |
|
---|
[04e3c200] | 148 | <sect2 role="commands">
|
---|
| 149 | <title>Command Explanations</title>
|
---|
| 150 |
|
---|
[f0f68c1] | 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 |
|
---|
[04e3c200] | 163 | <para>
|
---|
| 164 | <parameter>--without-included-zlib</parameter>: This switch enables
|
---|
[f0f68c1] | 165 | compilation with the system-installed zlib library.
|
---|
[04e3c200] | 166 | </para>
|
---|
| 167 |
|
---|
| 168 | </sect2>
|
---|
| 169 |
|
---|
[5ab6e72] | 170 | <sect2 role="configuration">
|
---|
| 171 | <title>Configuring rsync</title>
|
---|
[0931098] | 172 |
|
---|
[5ab6e72] | 173 | <sect3 id="rsync-config">
|
---|
| 174 | <title>Config Files</title>
|
---|
[0931098] | 175 |
|
---|
[b51fe6e] | 176 | <para>
|
---|
| 177 | <filename>/etc/rsyncd.conf</filename>
|
---|
| 178 | </para>
|
---|
[0931098] | 179 |
|
---|
[5ab6e72] | 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 |
|
---|
[b51fe6e] | 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>
|
---|
[fdf798a6] | 193 |
|
---|
[b51fe6e] | 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>
|
---|
[5ab6e72] | 199 |
|
---|
| 200 | <screen role="root"><userinput>cat > /etc/rsyncd.conf << "EOF"
|
---|
| 201 | <literal># This is a basic rsync configuration file
|
---|
[0931098] | 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
|
---|
[5ab6e72] | 214 | </literal>
|
---|
| 215 | EOF</userinput></screen>
|
---|
[0931098] | 216 |
|
---|
[b51fe6e] | 217 | <para>
|
---|
| 218 | You can find additional configuration information and general
|
---|
| 219 | documentation about <command>rsync</command> at
|
---|
[f0f68c1] | 220 | <ulink url="https://rsync.samba.org/documentation.html"/>.
|
---|
[b51fe6e] | 221 | </para>
|
---|
[bccbdaea] | 222 |
|
---|
[5ab6e72] | 223 | </sect3>
|
---|
[0931098] | 224 |
|
---|
[fdf798a6] | 225 | <sect3 id="rsync-init">
|
---|
[7b478500] | 226 | <title><phrase revision="sysv">Boot Script</phrase>
|
---|
| 227 | <phrase revision="systemd">Systemd Unit</phrase></title>
|
---|
[0931098] | 228 |
|
---|
[b51fe6e] | 229 | <para>
|
---|
[f0f68c1] | 230 | Note that you only need to start the
|
---|
[b51fe6e] | 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>
|
---|
[0931098] | 247 |
|
---|
[5ab6e72] | 248 | <screen role="root"><userinput>make install-rsyncd</userinput></screen>
|
---|
[0931098] | 249 |
|
---|
[7b478500] | 250 | <note revision="systemd">
|
---|
[b51fe6e] | 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
|
---|
[8558044] | 259 | using <application>{,x}inetd</application> on a SysVinit based
|
---|
[b51fe6e] | 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>
|
---|
[7b478500] | 269 |
|
---|
[a42c273] | 270 | <screen role="nodump"><userinput>systemctl stop rsyncd &&
|
---|
[7b478500] | 271 | systemctl disable rsyncd &&
|
---|
| 272 | systemctl enable rsyncd.socket &&
|
---|
| 273 | systemctl start rsyncd.socket</userinput></screen>
|
---|
| 274 |
|
---|
[b51fe6e] | 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>
|
---|
[7b478500] | 279 | </note>
|
---|
| 280 |
|
---|
[5ab6e72] | 281 | </sect3>
|
---|
[0931098] | 282 |
|
---|
[5ab6e72] | 283 | </sect2>
|
---|
[0931098] | 284 |
|
---|
[5ab6e72] | 285 | <sect2 role="content">
|
---|
| 286 | <title>Contents</title>
|
---|
[0931098] | 287 |
|
---|
[5ab6e72] | 288 | <segmentedlist>
|
---|
| 289 | <segtitle>Installed Program</segtitle>
|
---|
| 290 | <segtitle>Installed Libraries</segtitle>
|
---|
| 291 | <segtitle>Installed Directories</segtitle>
|
---|
[0931098] | 292 |
|
---|
[5ab6e72] | 293 | <seglistitem>
|
---|
[f0f68c1] | 294 | <seg>rsync and rsync-ssl</seg>
|
---|
[5ab6e72] | 295 | <seg>None</seg>
|
---|
[fdf798a6] | 296 | <seg>Optionally, /usr/share/doc/rsync-&rsync-version;</seg>
|
---|
[5ab6e72] | 297 | </seglistitem>
|
---|
| 298 | </segmentedlist>
|
---|
[0931098] | 299 |
|
---|
[5ab6e72] | 300 | <variablelist>
|
---|
| 301 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 302 | <?dbfo list-presentation="list"?>
|
---|
| 303 | <?dbhtml list-presentation="table"?>
|
---|
[0931098] | 304 |
|
---|
[5ab6e72] | 305 | <varlistentry id="rsync-prog">
|
---|
| 306 | <term><command>rsync</command></term>
|
---|
| 307 | <listitem>
|
---|
[b51fe6e] | 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
|
---|
[4c24eb0a] | 314 | files are present at one end of the link beforehand
|
---|
[b51fe6e] | 315 | </para>
|
---|
[5ab6e72] | 316 | <indexterm zone="rsync rsync-prog">
|
---|
| 317 | <primary sortas="b-rsync">rsync</primary>
|
---|
| 318 | </indexterm>
|
---|
| 319 | </listitem>
|
---|
| 320 | </varlistentry>
|
---|
[0931098] | 321 |
|
---|
[f0f68c1] | 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
|
---|
[4c24eb0a] | 327 | has SSL support built in
|
---|
[f0f68c1] | 328 | </para>
|
---|
| 329 | <indexterm zone="rsync rsync-ssl">
|
---|
| 330 | <primary sortas="b-rsync-ssl">rsync-ssl</primary>
|
---|
| 331 | </indexterm>
|
---|
| 332 | </listitem>
|
---|
| 333 | </varlistentry>
|
---|
| 334 |
|
---|
[5ab6e72] | 335 | </variablelist>
|
---|
[46cef72] | 336 |
|
---|
[5ab6e72] | 337 | </sect2>
|
---|
[46cef72] | 338 |
|
---|
[5ab6e72] | 339 | </sect1>
|
---|