How to monitor the frequency of processes writing to a file on Linux

181 views Asked by At

Just wondering if there is a way (tool/script) to monitor, similar to the way the "top" command monitors processes, the write operations performed by process to a file, especially log files.

AFAIK that "fuser" could be a candidate when put in a sleep-n-continue loop but there's a chance that the write operation might not last long enough for the "fuser" to capture. Or is there a way to address that issue?

Desired pseudo-output:

 PID    # of writes    bytes written
 2048       33             31280
 2049       31             23244
1

There are 1 answers

1
Michael Hausenblas On BEST ANSWER

You might find iotop and fatrace useful to help you achieve what you want.