Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

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.

share|improve this answer

Your Answer

 
discard

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.