只是内网同步,故而可以省略很多安全方面的东东。不需要通过ssh,而是通过rsync协议。不需要用户名认证,保证只读。
rsync用standalone的daemon方式,而不用service方式操作。
由于合规限制,暂时走非标准端口,现在记录一下过程。
一,/etc/rsyncd/rsyncd.conf文件内容:
# Minimal configuration file for rsync daemon # See rsync(1) and rsyncd.conf(5) man pages for help # This line is required by the /etc/init.d/rsyncd script # GLOBAL OPTIONS uid = root gid = root use chroot = no read only = yes #limit access to private LANs max connections = 2048 pid file = /var/run/rsyncd.pid lock file = /var/run/rsync.lock log file = /var/log/rsync.log #This will log every file transferred - up to 85,000+ per user, per sync transfer logging = yes log format = %t %a %m %f %b syslog facility = local3 timeout = 600 # MODULE OPTIONS [pppp] path = /xxxx_vol1/a/b/ list=yes ignore errors comment = Package Store
二,启动rsync server:
rsync --daemon --config=/etc/rsyncd/rsyncd.conf --port=873
三,在客户端同步,注意一下调整参数:
rsync -avWP --bwlimit=50000 --block-size=512 --timeout=600 --checksum --port=4505 --delete rsync://1.2.3.3/pppp/abc /tmp/abc/
时间: 2024-09-20 19:53:05