1 Configure the Rsync server, client, see previous article
/www Backup to Rsync192.168.1.11/tmp/backup in 192.168.1.10web server
2 Download and install INotify
wget http://github.com/downloads/rvoicilas/inotify-tools/inotify-tools-3.14.tar.gz
Unzip./configure make make Install
3 Introduction
Inotify-tools provides two command-line tools:
Inotifywait: Class for continuous monitoring.
Inotifywatch: Statistical information.
4 Implement monitoring uploads
vim/in.sh
#!/bin/bash
Inotifywait-mrq--timefmt '%d/%m/%y%h:%m '--format '%T%w%f%e '-e modify,delete,create,attrib/www | While read files
Do
Rsync-avz--delete--password-file=/etc/rsync.password/www [email protected]::backup
Done Save
5 Background Execution Script
Nohup/in.sh &(using program deployment nohup)
6 Boot up
echo "in.sh&" >>/etc/rc.local
This article is from the "Itcain" blog, make sure to keep this source http://521kun.blog.51cto.com/9397206/1773596
Rsync+inotify automatic synchronized backup of folders