centos7部署rsync服务进行数据同步

2022-04-01 15:03:54 浏览数 (2)

前言

rsync的目的是实现本地主机和远程主机上的文件同步。

安装

代码语言:javascript复制
yum install rsync

配置

代码语言:javascript复制
port = 873                
use chroot = no
uid = nginx
gid = nginx
max connections = 200
timeout = 600
pid file = /var/run/rsyncd.pid
lock file = /var/run/rsyncd.lock
log file = /var/log/rsyncd.log


[games_frontend]
path = /opt/project/gamestore/games_frontend/
ignore errors
read only = no
auth users = gameh5
secrets file = /etc/rsyncd.secrets
代码语言:javascript复制
gameh5:Z@W8KtBL

启动

代码语言:javascript复制
systemctl enable --now  rsyncd

数据同步

代码语言:javascript复制
rsync -azP --delete gameh5@172.16.4.10::c_h5  ./c_h5  --password-file=rsync.secrets
代码语言:javascript复制
Z@W8KtBL

0 人点赞