Setup the Rsync Daemon

Setup the Rsync Daemon
Photo by Thorsten Konersmann / Unsplash

Rsync is a brilliant package that allows you to quite simply sync files from one system to another. By default it utilises SSH which sometimes isn't convenient for example when automating an Rsync task. Instead you can use the Rsync daemon or module.

Installation

Installation on a Debian based system is as simple as this...

sudo apt install rsync

Example Configuration

The configuration file can be found at /etc/rsyncd.conf

sudo nano /etc/rsyncd.conf

Here is an example configuration

uid = 0
gid = 0
use chroot = yes
max connections = 4
syslog facility = local5

[Test]
    path = /srv/Test/
    comment = Rsync Test
    read only = false
  • [Test] is the name of the share. For example when rsyncing to or from this you would use rsync 10.0.0.5::Test/
  • path is the path to where you want the other system to rsync to and from
  • comment is just quite simply a comment
  • If read only is set to true then you can only pull files from the path specified above. When set to false you can push and pull.

Enable and Start the Service

sudo systemctl enable --now rsync

Check the Service

sudo systemctl status rsync

You should see a line showing the daemon running on TCP 873