1. 程式人生 > >inotify 同步腳本

inotify 同步腳本

ech roo AS ogre orm rom path -- efm

#!/bin/bash

path1=/home/htoa/tomcat/webapps/ROOT/htoa/
ip=192.168.30.13

/usr/bin/inotifywait -mrq --timefmt %y/%m%d %H:/%M --format %T %w%f -emodify,delete,create,attrib $path1 | while read file;
do
rsync -avz --delete  --progress --exclude-from="/usr/local/src/scripts/exclude.list" $path1 root@$ip:$path1
echo "
${file} was rsynced" >> /var/log/rsync.log 2>&1 done

inotify 同步腳本