Finding the size of open files
A quick pipe hack
Here's a one-liner that will allow you to search for open files on a disk, then display the file size. Note that the parameter for findp can be altered to restrict the search to specific file types that are open (e.g., ".log").
$ pipe sh dev /file | findp " [" | eachline file -
"pipe file = f$extr(24,99,file) ; dire/size=all &file"
Note that findp is a shortcut symbol for "search sys$pipe" and eachline comes from dcl.openvms.org. This one liner can be added to your login.com.
I used this recently when I found that one of my disk drives was getting full, but I couldn't identify what was hogging the space. It turned out that an SMTP process was stuck processing spam, and it was filling up a log file. The log file didn't appear to be growing -- the space used was sitting stationary -- but it turned out the allocated space was way beyond that. This one-liner allowed me to quickly find all the open files and show me what kind of disk space they were using.
No comments:
No trackbacks: