Skip to main content
edited tags; edited tags
Link
Gilles 'SO- stop being evil'
  • 865.4k
  • 205
  • 1.8k
  • 2.3k
Source Link
Martin Vegter
  • 798
  • 81
  • 257
  • 449

using inotify to monitor access to a file

I would like to have a trigger and when a particular file is accessed by some process, I would like to be notified (i.e. a script should be run). If I understand correctly, this could be achieved with inotify.

If I have a file /foo/bar.txt how would I set up inotify to monitor that file?

I am using Debian Wheezy with kernel 3.12 (my kernel has inotify support)