#
inotifywait -mrq --timefmt '%d/%m/%y %H:%M' --format '%T %w%f %e' \
--event modify,create,move,delete ${src} | while read date time file event
do
echo $event
for i in $des
do
case $event in
MODIFY|CREATE|MOVE|MODIFY,ISDIR|CREATE,ISDIR|MODIFY,ISDIR)
#echo $src
no_src_root_file_name=`echo $file|sed "s#$src##g"`
final_target_dest=$i$no_src_root_file_name
echo rsync -avz --delete --progress $file $final_target_dest
rsync -avz --delete --progress $file $final_target_dest
;;
DELETE|DELETE,ISDIR)
src_file_up_dir=`echo $file|awk -F"/" '{NF=NF-1;OFS="/";print $0}'`
no_root_src_file_up_dir=`echo $file|awk -F"/" '{NF=NF-2;OFS="/";print $0}'|sed "s#$src##g"`
final_target_dest_up_dir=$i$no_root_src_file_up_dir
echo rsync -avz --delete --progress $src_file_up_dir $final_target_dest_up_dir
rsync -avz --delete --progress $src_file_up_dir $final_target_dest_up_dir
;;
esac
done
done
############################################################################################
rsync.conf
local directory=/EBS/www/projects
#dest_here
dest=root@174.129.219.40:/EBS/www
20090723:
--format '%T %w%f'