Say for example you had a shell script that utilises inotifywait in the following form
inotifywait -m -e create /home/user1/*/*
Essentially you are asking it to monitor all folders two levels under user1. I’ve noticed with inotify that it can not dynamically index new folders.
For example you have a file system like
/home
/user1
/a
/b
Then you run the inotifywait script, it will monitor actions on the ‘b’ folder.
If you were to then add a new folder ‘c’ under ‘a’ (same level as ‘b’), inotify will not monitor actions on this folder. Anyone got a way of remedying this?
Go up a level and monitor that with the recursive switch.
I don’t know what you are using this for, but for indefinite watching you might want to check out iwatch.