#### Beyond Linux® From Scratch (systemd Edition) - Version r13.0-491

### Chapter 15. Networking Programs

- Prev

  rpcbind-1.2.8

- Next

  Samba-4.24.0

- Up
- Home

# rsync-3.4.2

## Introduction to rsync

The rsync package contains the rsync utility. This is useful for synchronizing large file archives over a network.

### Note

Development versions of BLFS may not build or run some packages properly if LFS or dependencies have been updated since the most recent stable versions of the books.

### Package Information

- Download (HTTP): https://www.samba.org/ftp/rsync/src/rsync-3.4.2.tar.gz

- Download MD5 sum: 352650b73e30cc0ba54707ae72bdac43

- Download size: 1.2 MB

- Estimated disk space required: 12 MB (with tests; add 50 MB for HTML API documentation)

- Estimated build time: 0.6 SBU (with tests)

### rsync Dependencies

#### Recommended

popt-1.19

#### Optional

Doxygen-1.17.0 and xxhash

## Installation of rsync

For security reasons, running the rsync server as an unprivileged user and group is encouraged. If you intend to run rsync as a daemon, create the `rsyncd` user and group with the following commands issued by the `root` user:

    groupadd -g 48 rsyncd &&
    useradd -c "rsyncd Daemon" -m -d /home/rsync -g rsyncd \
        -s /bin/false -u 48 rsyncd

Install rsync by running the following commands:

    ./configure --prefix=/usr    \
                --disable-xxhash \
                --without-included-zlib &&
    make

If you have Doxygen-1.17.0 installed and wish to build HTML API documentation, issue:

    doxygen

To run the tests, issue:

    make check

Now, as the `root` user:

    make install

If you built the documentation, install it using the following commands as the `root` user:

    install -v -m755 -d          /usr/share/doc/rsync-3.4.2/api &&
    install -v -m644 dox/html/*  /usr/share/doc/rsync-3.4.2/api

## Command Explanations

`--disable-xxhash`: This switch disables advanced xxhash checksum support. Remove this switch if you have installed xxhash.

`--without-included-zlib`: This switch enables compilation with the system-installed zlib library.

## Configuring rsync

### Config Files

`/etc/rsyncd.conf`

### Configuration Information

For client access to remote files, you may need to install the OpenSSH-10.3p1 package to connect to the remote server.

This is a simple download-only configuration to set up running rsync as a server. See the rsyncd.conf(5) man-page for additional options (i.e., user authentication).

    cat > /etc/rsyncd.conf << "EOF"
    # This is a basic rsync configuration file
    # It exports a single module without user authentication.

    motd file = /home/rsync/welcome.msg
    use chroot = yes

    [localhost]
        path = /home/rsync
        comment = Default rsync module
        read only = yes
        list = yes
        uid = rsyncd
        gid = rsyncd

    EOF

You can find additional configuration information and general documentation about rsync at https://rsync.samba.org/documentation.html.

### Systemd Unit

Note that you only need to start the rsync server if you want to provide an rsync archive on your local machine. You don't need this unit to run the rsync client.

Install the `rsyncd.service` unit included in the blfs-systemd-units-20251204 package.

    make install-rsyncd

### Note

This package comes with two types of units: A service file and a socket file. The service file will start rsync daemon once at boot and it will keep running until the system shuts down. The socket file will make systemd listen on rsync port (Default 873, needs to be edited for anything else) and will start rsync daemon when something tries to connect to that port and stop the daemon when the connection is terminated. This is called socket activation and is analogous to using {,x}inetd on a SysVinit based system.

By default, the first method is used - rsync daemon is started at boot and stopped at shutdown. If the socket method is desired, you need to run as the `root` user:

    systemctl stop rsyncd &&
    systemctl disable rsyncd &&
    systemctl enable rsyncd.socket &&
    systemctl start rsyncd.socket

Note that socket method is only useful for remote backups. For local backups you'll need the service method.

## Contents

Installed Program: rsync and rsync-ssl
Installed Libraries: None
Installed Directories: Optionally, /usr/share/doc/rsync-3.4.2

### Short Descriptions

rsync | is a replacement for rcp (and scp) that has many more features. It uses the “rsync algorithm” which provides a very fast method of syncing remote files. It does this by sending just the differences in the files across the link, without requiring that both sets of files are present at one end of the link beforehand
rsync-ssl | is a helper script used when connecting to an rsync daemon that has SSL support built in

- Prev

  rpcbind-1.2.8

- Next

  Samba-4.24.0

- Up
- Home