Step 1 – Install rsync
Install rsync with apt command
sudo apt-get -y install rsync

Step 2 – Configure rsync daemon
Configure rsync config using nano , it will automatically create file if not exist
vi /etc/rsyncd.conf

# destination directory
path = /home/backup
# hosts you allow to access, only allow ip
hosts allow =
# deny all host
hosts deny = *
list = true
# user permission
uid = root
#group permission
gid = root
#can write to this directory
read only = false
Step 3 – Start and enable at booting

After you configure in Step 2 , we will start the rsync daemon and automatically make it start when server boot
Start the daemon

sudo systemctl start rsync
sudo systemctl enable rsync