set up rsync server

To set up an rsync backup server on Arch Linux for use with a ReadyNAS, follow these steps:


1. Install rsync

Install rsync on your Arch Linux system:

sudo pacman -S rsync

2. Create a Backup Directory

Choose a directory to store the backups, e.g., /backup, and ensure proper permissions:

sudo mkdir /backup
sudo chown rsync:rsync /backup
sudo chmod 700 /backup

3. Create a Dedicated User

Create a user (e.g., rsync) for secure file transfers:

sudo useradd -m -d /home/rsync -s /bin/false rsync
sudo passwd rsync

4. Configure rsyncd.conf

Edit or create /etc/rsyncd.conf for your rsync server configuration:

sudo nano /etc/rsyncd.conf

Example configuration:

uid = rsync
gid = rsync
use chroot = yes
max connections = 4
log file = /var/log/rsyncd.log
pid file = /var/run/rsyncd.pid

[backup]
    path = /backup
    comment = ReadyNAS Backup
    read only = no
    auth users = rsync
    secrets file = /etc/rsyncd.secrets

5. Set Up Authentication

Create a secrets file for authentication:

sudo nano /etc/rsyncd.secrets

Add a line with the username and password (e.g., rsync:yourpassword):

rsync:yourpassword

Set proper permissions:

sudo chmod 600 /etc/rsyncd.secrets

6. Start the rsync Daemon

Enable and start the rsyncd service:

sudo systemctl enable rsyncd.service
sudo systemctl start rsyncd.service

7. Configure ReadyNAS

On your ReadyNAS:

  1. Go to Backup settings.
  2. Select Remote: Rsync Server.
  3. Enter the Arch Linux server’s IP, module name (backup), username (rsync), and password (yourpassword).

8. Test the Backup

Manually test connectivity from ReadyNAS or any client:

rsync rsync://rsync@<your-arch-linux-ip>/backup

If this lists the backup directory, your setup is ready.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *