实时同步还可以使用inotify+rsync命令,但是不太方便https://www.cnblogs.com/forlive/p/10769895.html
sersync还可以实现开机自启动
配置rsync守护进程
- 安装rsync
yum install rsync
- 修改rsync配置文件/etc/rsyncd.conf,默认就是这个文件
# /etc/rsyncd: configuration file for rsync daemon mode
# See rsyncd.conf man page for more options.
# configuration example:
uid = developer
gid = developer
fake super = yes
use chroot = no
max connections = 200
timeout = 900
ignore nonreadable = yes
read only = false
pid file = /var/run/rsyncd.pid
log file = /var/log/rsyncd.log
dont compress = *.gz *.tgz *.zip *.z *.Z *.rpm *.deb *.bz2
auth users = img
secrets file = /etc/rsync.passwd
# 这块是模块名称
[imgs]
path = /data/portal/backgroundImgs
- 添加密码文件/etc/rsync.passwd,文件中格式 用户名:密码
img:img
标签:rsync,sersync,log,img,etc,file,rsyncd
From: https://www.cnblogs.com/forlive/p/17007762.html