服务端修改:
1. 服务端/etc/rsyncd.conf
port = 3380
pid file = /var/run/rsyncd.pid
log file = /var/log/rsyncd.log
uid = root
gid = root
use chroot = no
max connections = 5
transfer logging = yes
timeout = 900
ignore nonreadable = yes
dont compress = *.gz *.tgz *.zip *.z *.Z *.rpm *.deb *.bz2
[log]
path = /var/log/squid
read only = no
list = true
auth users = root
secrets file = /etc/rsync.passwd
保存退出
2. 创建密码文件 echo "root:123" > /etc/rsync.passwd, 修改文件权限chmod 600 /etc/rsync.passwd
3. 云服务开启端口访问
客户端配置
1. 创建密码文件 echo "123" > /etc/rsync.passwd
2. 执行rsync -avz --port 33380 --include="access.log" --exclude="*" root@ip::log /data1/dorylus/logs/crawler_connect --password-file=/etc/rsync.passwd --inplace --no-whole-file