I am new to dnotify/inotify command. Can any one help me how to write a script such that it continuously monitors a directory and indicates that there is some change or modification to it.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Inotify itself is a kernel module accesible via calls from e.g. a C program.
https://linux.die.net/man/7/inotify
There is an application suite called inotify-tools, which contains:
and
You can use inotify directly from command line, e.g. like this to continuously monitor for all changes under home directory (may generate lots of output):
And here is a script that monitors continuously and reacts to Apache log activity, copied from the man file of inotifywait: