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

1 Answer 1

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.

2
  • Bib, do you know of any tool that will work on bare unix servers also? We have some IBM AIX unix servers in our fleet, and it would be nice if we had a single tool that would work on all our servers. Commented Dec 29, 2022 at 18:35
  • @user2279952 Have you searched for inotifywatch & aix? Commented Dec 29, 2022 at 20:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .