inotify排除多个目录

inotify排除多个目录bash

    inotify中使用--exclude只能使用一次,屡次使用,后面的语句会覆盖前面的exclude。ide

故引入参数--fromfile,在文件中能够定义监控的目录与不监控的目录(不监控目录前加@)。spa

wKioL1muYf2DUqKEAAA_HEEcH88779.jpg-wh_50


#!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

wKiom1muYkqAF61wAAIZ-cfj6f8906.jpg-wh_50

相关文章
相关标签/搜索