If I run:
$ inotifywait -r -e close_write --format '%w%f' /tmp/
and then do the following in /tmp:
$ mkdir test $ touch test/test_subdir.txt $ touch test_outer_dir.txt
then inotifywait will output:
/tmp/test_outer_dir.txt
i.e. it completely missed the first file, /tmp/test/test_subdir.txt.
If I add the -m flag to inotifywait:
$ inotifywait -r -m -e close_write --format '%w%f' /tmp/
then it works as expected... in the example above, the output would be:
/tmp/test/test_subdir.txt /tmp/test_outer_dir.txt
I observe this behavior consistently with inotify-tools 3.13 in Precise and 3.14 in Trusty.
If I run:
$ inotifywait -r -e close_write --format '%w%f' /tmp/
and then do the following in /tmp:
$ mkdir test subdir. txt
$ touch test/test_
$ touch test_outer_dir.txt
then inotifywait will output:
/tmp/test_ outer_dir. txt
i.e. it completely missed the first file, /tmp/test/ test_subdir. txt.
If I add the -m flag to inotifywait:
$ inotifywait -r -m -e close_write --format '%w%f' /tmp/
then it works as expected... in the example above, the output would be:
/tmp/test/ test_subdir. txt outer_dir. txt
/tmp/test_
I observe this behavior consistently with inotify-tools 3.13 in Precise and 3.14 in Trusty.