rsync排除目录 同步方法
[root@~]# more /opt/rsync/rsync-26To35optwwwdataExclude.sh
#!/bin/bash
SRC=/opt/www/data/
DES=data
WEB2=192.168.1.35
USER=root
/usr/local/bin/inotifywait --fromfile '/etc/exclude/excludedata.list' -mrq -e create,move,modify $SRC | while read D E F
do
rsync --no-iconv -ahqzt --exclude-from=/etc/exclude/excludedata1.list --password-file=/etc/rsync.passwd1 --progress $SRC $USER@$WEB2::$DES
done
[root@~]# more /etc/exclude/excludedata.list
@/opt/www/data/magazine/
@/opt/www/data/newspaper/
[root@~]# more /etc/exclude/excludedata1.list
magazine
newspaper