Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I need your help - using Inotify I am watching a directory for the changes like create, delete, rename and move. I want these event to be logged in a file and I want to run Inotify as a service.

share|improve this question

1 Answer 1

You need to install incron package. Then, adding new events to be monitored can be done using

incrontab -e

You can add a line to monitor specific directory. The general format is like:

<path> <mask> <command>

Directory path should be specified first, followed by event mask, and finally the command/script you want to execute. You can read man 5 incrontab for available masks and more info.

In your case, you can create a script to log the relevant events.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.