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