Rsync server on Raspberry Pi over Debian

How to configure rsync server on Raspebery over Debian

 

First of all, you have to install rsync package:

apt-get install rsync

 

Create and edit RSync configuration file:

sudo vi /etc/rsyncd.conf

 

Here is my configuration file:

uid=nobody
gid=nogroup
max connections=50
socket options=SO_KEEPALIVE
address=10.8.0.1
[raspberry]
path=/var/backups/raspberry/
comment=Rpis backups
readonly=no

 

Note that this configuration file is a bit specific as:

  • Rsyncd is only listening to the VPN interface
  • There is not authentification (as we are in a “safe” environment)

 

Create the folder:

sudo mkdir/var/backups/raspberry/

 

And adjust the owner:

sudo chownnobody:nogroup/var/backups/raspberry/

 

We can now start the server:

sudo /etc/init.d/rsync start

 

Check that it’s started:

sudo /etc/init.d/rsync status

 

To start rsyncd automatically, edit the following file:

sudo vi /etc/default/rsync

 

And adjust the parameters as follow:

RSYNC_ENABLE=true

 

From a remote host, we can test the connection:

$ rsync rsync://10.8.0.1
raspberry       Rpis backups
 

Ready to sync !

 

 

Leave a Reply