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

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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.