0

In Unix do you know of a way to do continuous open-file-handle monitoring?

I know of lsof, which has a maximum sampling rate of 1s. However, I'm looking to do the exact same thing except continuously, so that it wouldn't miss files which are open for less than 1s. Do you know of any method for accomplishing this on Unix?

I'm aware of strace and fatrace but I'm looking to accomplish this on non-Linux versions of Unix as well such as on BSD-based servers.

Thank you,

James Pedersen

user2279952
  • 101
  • 2

1 Answers1

1

inotifywatch can monitor a directory and it's sub-directories, at least on freebsd as well as linux. This can tell you if a file is opened amongst other attributes. The man page is quite large, but you should be able to work out what you need from it. Be aware though, adding a watch with many sub-directories can impact resources.

Bob Goddard
  • 1,482