I have a problem where inotify, no matter what I do, doesn't detect changes in one specific folder. It detects changes in other folders that otherwise are no different. What could be causing this?inotifywait 3.14Linux titan 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt25-2+deb8u3 (2016-07-02) x86_64 GNU/Linuxinotify works as expected here:In one terminal:ben@titan:~$ mkdir -p notifytest/exampleben@titan:~$ cd notifytestben@titan:~/notifytest$ inotifywait -rme attrib,modify,move,create,delete . --exclude '(log|[a-z]+.sqlite)'In another terminal:ben@titan:~$ cd notifytestben@titan:~/notifytest$ touch test.txtben@titan:~/notifytest$ touch example/test.txtben@titan:~/notifytest$ rm example/test.txtben@titan:~/notifytest$ rm test.txtOutput:Setting up watches.  Beware: since -r was given, this may take a while!Watches established../ CREATE test.txt./ ATTRIB test.txt./example/ CREATE test.txt./example/ ATTRIB test.txt./example/ DELETE test.txt./ DELETE test.txtinotify doesn't work as expected here:I have an existing folder called blog that is ignored :(I create a new folder called example that is correctly watchedIn one terminal:ben@titan:~$ cd some-pathben@titan:~/some-path$ lsdrwxr-xr-x 3 ben     ben      4096 Aug 16 14:23 blog-rw-r--r-- 1 ben     ben     17408 Aug 15 13:58 blog.sqlite-rw-r--r-- 1 ben     ben       325 Aug 15 13:01 config.py-rw-r--r-- 1 www-run www-run 91800 Aug 16 14:23 logdrwxr-xr-x 2 ben     ben      4096 Aug 15 14:14 public_html-rw-r--r-- 1 ben     ben      1999 Aug 15 16:21 schema.sql-rwxr-xr-x 1 ben     ben      6019 Aug 16 14:01 start.pyben@titan:~/some-path$ mkdir exampleben@titan:~/some-path$ lsdrwxr-xr-x 3 ben     ben      4096 Aug 16 14:23 blog-rw-r--r-- 1 ben     ben     17408 Aug 15 13:58 blog.sqlite-rw-r--r-- 1 ben     ben       325 Aug 15 13:01 config.pydrwxr-xr-x 2 ben     ben      4096 Aug 16 14:28 example-rw-r--r-- 1 www-run www-run 91800 Aug 16 14:23 logdrwxr-xr-x 2 ben     ben      4096 Aug 15 14:14 public_html-rw-r--r-- 1 ben     ben      1999 Aug 15 16:21 schema.sql-rwxr-xr-x 1 ben     ben      6019 Aug 16 14:01 start.pyben@titan:~/some-path$ file exampleexample: directoryben@titan:~/some-path$ file blogblog: directoryben@titan:~/some-path$ inotifywait -rme attrib,modify,move,create,delete . --exclude '(log|[a-z]+.sqlite)'In another terminal:ben@titan:~$ cd some-pathben@titan:~/some-path$ touch test.txtben@titan:~/some-path$ touch blog/test.txtben@titan:~/some-path$ touch example/test.txtben@titan:~/some-path$ rm test.txtben@titan:~/some-path$ rm blog/test.txt ben@titan:~/some-path$ rm example/test.txt Output:inotifywait -rme attrib,modify,move,create,delete . --exclude '(log|[a-z]+.sqlite)'Setting up watches.  Beware: since -r was given, this may take a while!Watches established../ CREATE test.txt./ ATTRIB test.txt./example/ CREATE test.txt./example/ ATTRIB test.txt./ DELETE test.txt./example/ DELETE test.txtExpected Output:inotifywait -rme attrib,modify,move,create,delete . --exclude '(log|[a-z]+.sqlite)'Setting up watches.  Beware: since -r was given, this may take a while!Watches established../ CREATE test.txt./ ATTRIB test.txt./example/ CREATE test.txt./example/ ATTRIB test.txt./blog/ CREATE test.txt./blog/ ATTRIB test.txt./ DELETE test.txt./example/ DELETE test.txt./blog/ DELETE test.txt
inotify not working on one specific folder
inotify
Your --exclude (log) pattern matches b**log**.Use ^log$ instead.