Setup a Rsync server on Gentoo
rsync is an open source utility that provides fast incremental file transfer, available in multiple platforms such as Linux, *BSD and Solaris.
The goal of this tutorial is to detail the needed steps to setup a general purpose rsync server on Gentoo. Note: this guide doesn’t focus on setting up your own Gentoo local rsync mirror, for that please consult Gentoo’s official documentation on the matter, namely Gentoo Linux rsync Mirrors Policy and Guide.
Let’s begin by becoming the superuser, synchronize the portage tree and install rsync:
- $ su
- # eix-sync
- # emerge –ask –tree –verbose net-misc/rsync
Having installed rsync let’s add it to the default runlevel so that it automatically starts at boot time:
- # rc-update add rsync default
Now we move into the rsync server configuration. The rsync server works with modules with are defined in the /etc/rsyncd.conf file. Let’s set up a general purpose module:
- # vim /etc/rsyncd.conf
motd file = /usr/local/etc/rsync.motd
log file = /var/log/rsyncd.log
pid file = /var/log/rsyncd.pid
lock file = /var/log/rsyncd.lock
transfer logging = true
use chroot = yes
[backup]
path = /home/username
read only = yes
list = yes
comment = Example of a rsync backup module
hosts allow = 192.168.1.0/24
It should be noted that a list of modules is returned from a rsync server when the server is queried:
- $ rsync example.no-ip.org::
backup Example of a rsync backup module
To start the rsync server immediately:
- $ su
- # /etc/init.d/rsyncd start
An example of a client side synchronization:
- $ rsync -av example.no-ip.org::backup/ /destination/
This would recursively transfer all files from the backup module directory on the example.no-ip.org machine into the /destination directory on the local machine. The files are transfered in “archive mode”, which ensures that symbolic links, devices, attributes, permissions, ownership, etc are preserved in the transfer. Also, compression is used to reduce the size of data portions of the transfer.
Take a look at the utility’s website for ideas on how to use rsync in useful ways.
Additional sources of information:
rsync website
man rsync
man rsyncd.conf







