前言
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