一、被同步机
1、/usr/bin/rsync --daemon
2、vi /etc/rsyncd.conf
d=nobody
gid = nobody
max connections = 200
timeout = 600
use chroot = no
read only = yes
pid file=/var/run/rsyncd.pid
host_allow =ip1/ip2/ip3...
log file=/var/log/rsyncd.log
[nginxmodule]
path = /opt/app/nginx/logs
comment = nginx_logs
[resinmodule]
path = /opt/app/resin/logs
comment = nginx_logs
...
二、同步机
1、rsync -avz root@remote_ip::nginxmodule/*.log /opt/app/nginx/logs/
参数说明:
-z 开启压缩
-v 详情输出
-r 表示递归
-a 称为归档模式,执行以下操作
递归模式
保留符号链接
保留权限
保留时间标记
保留用户名及组名
1、/usr/bin/rsync --daemon
2、vi /etc/rsyncd.conf
d=nobody
gid = nobody
max connections = 200
timeout = 600
use chroot = no
read only = yes
pid file=/var/run/rsyncd.pid
host_allow =ip1/ip2/ip3...
log file=/var/log/rsyncd.log
[nginxmodule]
path = /opt/app/nginx/logs
comment = nginx_logs
[resinmodule]
path = /opt/app/resin/logs
comment = nginx_logs
...
二、同步机
1、rsync -avz root@remote_ip::nginxmodule/*.log /opt/app/nginx/logs/
参数说明:
-z 开启压缩
-v 详情输出
-r 表示递归
-a 称为归档模式,执行以下操作
递归模式
保留符号链接
保留权限
保留时间标记
保留用户名及组名