rsync+inotify实现在线同步文件夹
发布时间
阅读量:
阅读量
通过结合rsync与inotify工具,可达成对目录内容的实时同步效果。
环境
| OS | IP | HOSTNAME |
|---|---|---|
| centos7 | 192.168.220.138 | server |
| centos7 | 192.168.220.139 | client |
rsync安装指南
[root@server ~]# yum install rsync -y
启动服务
[root@server ~]# systemctl start rsyncd
设置开机自启
[root@server ~]# systemctl enable rsyncd
Created symlink from /etc/systemd/system/multi-user.target.wants/rsyncd.service to /usr/lib/systemd/system/rsyncd.service.
端口873
[root@server ~]# netstat -anutp | grep rsync
tcp 0 0 0.0.0.0:873 0.0.0.0:* LISTEN 9
全部评论 (0)
还没有任何评论哟~
