Wbm2009v2/rsync-daemon
From Hackerspace Brussels
Parent: Wbm2009v2
Contents |
[edit] How to set up rsyncd for internal server
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:
cd NEWEMPTYFOLDER rsync -av rsync://192.168.42.42/openwrt .
To refresh changes:
cd NEWEMPTYFOLDER rsync -av --delete rsync://192.168.42.42/openwrt .
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://192.168.42.42/openwrt .
If you want to skip more folders do like this example
cd NEWEMPTYFOLDER echo downloads.openwrt.org >> rsync.excl echo trunk_svn >> rsync.excl rsync -av --exclude-from=rsync.excl rsync://192.168.42.42/openwrt .
[edit] step 1 Create /etc/rsyncd.conf
pid file = /var/run/rsyncd.pid
use chroot = yes
read only = yes
[openwrt]
comment = wbm2009v2
path = /opt/openwrt
read only = yes
list = yes
uid = nobody
[edit] step2 add rsync to inetd.conf
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
[edit] step3 apply inetd config file
#ps aux | grep inet root 2894 0.0 0.0 1996 636 ? Ss Oct17 0:00 /usr/sbin/inetd
#sudo kill -HUP 2894
[edit] rsync
#rsync 192.168.42.42::openwrt