crontab + rsyncd同步方案

目的主机:

 rsync --daemon

[root@iZ23ohdbxmrZ ~]# vim /etc/rsyncd.conf

#global settings
port = 873
pid file=/var/run/rsyncd.pid
lock file=/var/run/rsyncd.lock
log file = /var/log/rsyncd.log
timeout = 600

#module settings
[vplay]
path = /data/www/**play/vplay/
use chroot = no
max connections = 30
read only = no
write only = no
list = no
uid = root
gid = root
hosts allow = *.40.113.136
hosts deny = *
ignore errors = yes
timeout = 120

源主机:

[root@iZ23xltxc7cZ ~]# crontab -e
*/1 * * * * rsync -tap /***/www/**play/vplay/* 121.40.215.203::vplay

将源主机1分钟同步一次到目的主机。

还可用lsyncd进行自动同步。

原文地址:https://www.cnblogs.com/kisf/p/4665780.html