I have initiated an inotify process with --fromfile option and the file contain the paths to be monitored.
/usr/local/maldetect/inotify/inotifywait -d -r -o /usr/local/maldetect/inotify/inotify_log --fromfile /usr/local/maldetect/sess/inotify.paths.28364 --exclude (^/var/tmp/mysql.sock) --timefmt %d %b %H:%M:%S --format %w%f %e %T -m -e create,move,modify
The file /usr/local/maldetect/sess/inotify.paths.28364 contain entries such as below.
/home/user1/public_html
/home/user2/public_html
/home/user3/public_html
There are almost 800 entries like this. What I need is, when a new user is created, the path /home/user4/public_html, should add the path dynamically to the existing inotify process without needing to re-initate the inotify process. As the initialization of inotify process is a bit resource hogging. Or anyway by which, if we add the path /home/user4/public_html to the file /usr/local/maldetect/sess/inotify.paths.28364, the inotify process will dynamically read it.