rsync+inotify
2016-06-20 11:10
183 查看
#rsync-server配置
#下载inotify
uid = nobody gid = nobody use chroot = no max connections = 10 strict modes = yes pid file = /var/run/rsyncd.pid lock file = /var/run/rsync.lock log file = /var/log/rsyncd.log hosts allow = 10.7.0.0/24 [server1] path = /var/www/extsuite commnet = backup ignore errors read only = no write only = no list = false uid = root uid = root auth users = backup secrets file = /etc/server.pass
#下载inotify
tar zxf inotify-tools-3.14.tar.gz cd inotify-tools-3.14 ./configure --prefix=/usr/local/inotify-3.14 make && make install nohup /bin/bash /sh/rsync.sh & echo "nohup /bin/bash /sh/rsync.sh &" >> /etc/rc.local#for bash
#!/bin/bash src=/home/domains/xxx/ #本地监控的目录 des=Email-file #13server的rsync服务的模块名 host=10.7.0.xxx #备份服务器的ip地址 /usr/local/inotify-3.14/bin/inotifywait -mrq --timefmt '%d/%m/%y %H:%M' --format '%T %w%f' -e modify,delete,create,attrib $src | while read files do for hostip in $host do rsync -vzrtopg --delete --progress --password-file=/etc/server.pass $src rsync_backup@$hostip::$des done echo "${files} was rsynced" >>/tmp/rsync.log 2>&1 done
相关文章推荐
- 使用 rsync 复制大文件的一些误解
- 如何在使用 scp 命令时递归地排除文件
- rsync 限制速度(防止rsync耗带宽)
- rsync ssh 数据同步分析
- rsync详解之exclude排除文件
- rsync结合find技巧分享
- rsync 数据同步使用详解
- 用rsync实现windows与linux文件同步的方法
- rsync命令排除文件和文件夹(exclude-from)
- Windows rsync服务器备份配置实例
- window系统的Rsync同步实战分析第1/2页
- 使用RSYNC在服务器间镜像或者备份目录和文件
- 利用rsync自动备份 完全配置方法 增加了ip限制
- Linux 用cp和rsync同步文件时跳过指定目录的方法
- rsync 同步错误 cwrsync rsync error rsync error: some files/attrs were not transferred 解决方法
- 用rsync对网站进行镜像备份实现步骤
- rsync中文手册之使用rsync实现网站镜像和备份linux第1/3页
- 使用rsync同步网路备份第1/2页
- 使用rsync来实现文件同步
- rsync相对于其他同步工具的优缺点介绍