inotify排除多個目錄
inotify中使用--exclude只能使用一次,多次使用,後面的語句會覆蓋前面的exclude。
故引入參數--fromfile,在文件中可以定義監控的目錄與不監控的目錄(不監控目錄前加@)。
#!bin/bash
/usr/local/bin/inotifywait -mrq --fromfile /root/test/inotify-ytginc/ytginc-fromfile.txt -e create,delete,modify /data/ytginc.com |while read file
do
echo $file
done
輸出的結果: