Rsyncd rsync daemonPosted: February 25, 2014
Let’s quickly set up a rsync server on an Ubuntu 12.04 server and run some backups.
We well do this logged in as root at each of the computers.
1. Setting up the server
- Edit the server configuration file /etc/rsyncd.conf, enter:
motd file = /etc/rsyncd.motd [test] path = /home/test/Documents comment = Test folder uid = user gid = user read only = no auth users = test secrets file = /etc/rsyncd.scrt
The path /home/test/Documents shall exist or you will receive error.
- Edit the Message of the Day file /etc/rsyncd.motd, enter anything, its just a welcoming message, e.g.:
Edit rsyncd password file (“secrets file”) /etc/rsyncd.scrt (rsycn uses its own username/password system), enter:
This is just a plain text, so change its permissions for you only to see its contents:
chmod 600 /etc/rsyncd.scrt
- Enable rsync daemon by editing /etc/default/rsync , changing the following settings:
RSYNC_ENABLE=true RSYNC_NICE='10' RSYNC_IONICE='-c3'
- Start the daemon and then check its status:
service rsync start service rsync status
Everything is fine if you see the following message:
* rsync is running
2. Setting up the client
- Edit password file ~/rsync/test.pwd to avoid typing the password manually and enter the password only:
Also hide its contents:
chmod 600 ~/rsync/test.pwd
- Copy some test directory over to the rsync server:
rsync --password-file ~/rsync/test.pwd -av /tmp/myTest test@remoteserver::test
- /tmp/myTest will copy the directory and its contents, /tmp/myTest/ will copy only the contents
- Important: using two colons in the remote address ( :: ) tells the program to use rsync protocol and connect to the rsyncd server (as opposed to the ssh )