From Hackerspace Brussels
Jump to: navigation, search

Parent: Wbm2009v2

How to set up rsyncd for internal server[edit]

This is actually ready, I have put the configuration file in my home folder and I'm running the rsynd daemon as

cd /home/saverio
rsync --daemon --config rsyncd.conf

To download:

rsync -av rsync:// .

To refresh changes:

rsync -av --delete rsync:// .

The --delete switch will delete from local disc the files that are not anymore on the server ! To do launch it in the wrong folder or you will erase data on your computer !!!

Probably you do not want to sync also the mirror of downloads.openwrt.org (~4GB), in this case do like this:

rsync -av --exclude 'downloads.openwrt.org' rsync:// .

If you want to skip more folders do like this example

echo downloads.openwrt.org >> rsync.excl
echo trunk_svn >> rsync.excl
rsync -av --exclude-from=rsync.excl rsync:// .

step 1 Create /etc/rsyncd.conf[edit]

pid file = /var/run/rsyncd.pid
use chroot = yes
read only = yes

        comment = wbm2009v2
        path = /opt/openwrt
        read only = yes
        list = yes
        uid = nobody

step2 add rsync to inetd.conf[edit]

cat /etc/inetd.conf tftp dgram udp wait root /usr/sbin/in.tftpd /usr/sbin/in.tftpd -s /var/lib/tftpboot rsync stream tcp nowait root /usr/bin/rsync rsyncd --daemon

step3 apply inetd config file[edit]

 #ps aux | grep inet
 root      2894  0.0  0.0   1996   636 ?        Ss   Oct17   0:00 /usr/sbin/inetd
 #sudo kill -HUP 2894