rsync
For the second time in as many days I've got to setup rsync to run as a daemon. Only yesterday I never bothered to make notes - which is a pain. I think I better remedy that situation...
First install rsync:
cd /usr/ports/net/rsync make install clean
Now configure the SOURCE box:
#
# /usr/local/etc/rsyncd.conf
#
pid file = /var/run/rsyncd.pid
use chroot = yes
[share]
path = /export/share
comment = Share directory
auth users = user
secrets file = /usr/local/etc/rsyncd.secrets
And:
# # /usr/local/etc/rsyncd.secrets # user:clearpassword
Make the rsyncd.secrets private:
chmod 0600 /usr/local/etc/rsyncd.secrets
And start:
echo "rsyncd_enable=\"YES\"" >> /etc/rc.conf /usr/local/etc/rc.d/rsyncd.sh start
On the DESTINATION this does the business:
rsync -av --delete rsync://user@123.123.123.123/share /export/share
As this will prompt fot the password it's not suitable for cron. However:
echo "clearpassword" > /usr/local/etc/rsyncd.passwd.share chown cronuser /usr/local/etc/rsyncd.passwd.share chmod 0600 usr/local/etc/rsyncd.passwd.share
Now add this to the correct crontab:
/usr/local/bin/rsync -a --delete --password-file=/usr/local/etc/rsyncd.passwd.share rsync://user@123.123.123.123/share /export/share 2>&1 >/dev/null
And relax in the knowlege that your data is safe..





