1. Receive-side install rsync, modify the/etc/rsyncd.conf configuration file, and then start the service.
UID = root
GID = root
Use chroot = no
Max connection = 4
Secrets file =/etc/rsyncd.secrets
=/tmp/= bak= no
2. Send-side installation RSYNC+LSYNCD, modify the/etc/lsyncd.conf profile, edit the password file (if password synchronization is used), and then start the LSYNCD service.
Settings = {logfile = "/var/log/lsyncd.log", Statusfile = "/tmp/lsyncd.stat", Statusinterval = 1,--synchronization interval}sync {DEFAULT.R Sync,source= "/data0/test", target= "[Email protected]::test", rsync = { binary = "/usr/bin/rsync", archive = True, compress = True, verbose = True, --delete = true, _extra = {"--password-file=/etc/ Rsyncd.secrets "},} ,}
3. Add and delete files in the directory to be synchronized on the sending side to see if the receiving side is synchronized.
Reference: http://openlinuxfly.blog.51cto.com/7120723/1679279
RSYNC+LSYNCD for real-time synchronization