Is there a way to be notified/trigger a script when a particular file is opened for reading or writing? I'm not specifically thinking of security but if anyone knows any linux/unix security mechanisms that can accomplish the same thing that will also work.

link|improve this question

20% accept rate
feedback

1 Answer

up vote 3 down vote accepted

Yep - incron uses the kernel's inotify mechanism, and will do exactly what you want. It's like "regular" cron, but instead of triggering jobs at certain time intervals, it triggers jobs based on filesystem changes.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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