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