The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to see which files are being written to?

Discussion in 'General Discussion' started by nothsa, Aug 19, 2005.

  1. nothsa

    nothsa Well-Known Member

    Joined:
    Nov 30, 2004
    Messages:
    69
    Likes Received:
    0
    Trophy Points:
    6
    I have a high disk I/O on one of my drives and am wanting to move files/folders that are written to often to another drive, and symlink them on the original drive. My only problem is that I don't know which files/folders are being written to the most.

    Is there any way that I can find this out?
     
  2. brianoz

    brianoz Well-Known Member

    Joined:
    Mar 13, 2004
    Messages:
    1,146
    Likes Received:
    6
    Trophy Points:
    38
    Location:
    Melbourne, Australia
    cPanel Access Level:
    Root Administrator
    Use the lsof utility. It may not be installed, you may have to use yum or similar to install it.

    lsof has a host of options and can tell you exactly which files are open by reading kernel tables.

    Another option that may be simpler is to use "find":
    Code:
    find /filesystem -mmin -60
    which will display all files modified in the last 60 minutes. (You can also use "find /filesystem -mtime -1" with older versions of find, but that shows all files modified in the last 24 hours).
     
Loading...

Share This Page