yum install inotify-tool
rsync-----------------------系统默认安装
vim inotify-tools.sh
/usr/local/bin/inotifywait -mrq -e modify,delete,create,attrib,move /app/java_project |while read events
do
rsync -av --delete /app/java_project/ root@10.1.1.100:/backup/app1_java
echo "`date +%F\ %T`事件$events" >> /var/log/rsync.log 2>&1
done
nohup ./inotify-tools.sh &