前言
rsync的目的是实现本地主机和远程主机上的文件同步。
安装
yum install rsync
配置
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
gameh5:Z@W8KtBL
启动
systemctl enable --now rsyncd
数据同步
# 注意目录前后,防止数据被删除
rsync -azP --delete gameh5@172.16.4.10::c_h5 ./c_h5 --password-file=rsync.secrets
Z@W8KtBL
评论 (0)