inotify排除多个目录bash
inotify中使用--exclude只能使用一次,屡次使用,后面的语句会覆盖前面的exclude。ide
故引入参数--fromfile,在文件中能够定义监控的目录与不监控的目录(不监控目录前加@)。spa
#!bin/bashblog
/usr/local/bin/inotifywait -mrq --fromfile /root/test/inotify-ytginc/ytginc-fromfile.txt -e create,delete,modify /data/ytginc.com |while read fileget
doit
echo $fileio
doneclass
输出的结果:test