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 输出的结果: 转载于:https://blog.51cto.com/chenxiaotao/1962871