Possible Duplicate:
Is it possible to find out what program or script created a given file?

How do I monitor the file system for specific purposes?

For example, I read that shutdown (when called with a delay) creates the file /etc/nologin to prevent login from accepting new users.

If I were to verify this, is there a tool I could ask, and then it would say, "That's right, between X and Y there was such a file and it was accessed 4 times" - ?

marked as duplicate by Gilles, Renan, jasonwryan, daisy, Mat Sep 22 '12 at 14:56

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 3
    You might get some ideas by searching this site for inotify or the auditd system. – jw013 Jul 25 '12 at 1:58

On systems that support it (Solaris, Free/NetBSD, Mac OS/X, Oracle Linux), a simple dtrace script would be a useful tool for this task.

  • I'm on Debian. But thumbs up anyway because those are very common systems. – Emanuel Berg Jul 25 '12 at 8:06

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