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.

site using too much disk space

Discussion in 'General Discussion' started by mitk, Dec 30, 2009.

  1. mitk

    mitk Well-Known Member

    Joined:
    May 14, 2003
    Messages:
    72
    Likes Received:
    0
    Trophy Points:
    6
    I am hosing a site and they are using 40 GB of diskspace, I talked with the owner and he doesn't have a clue on how he is using this much. He thinks there is an error in my reporting system.

    Does anyone have any suggestions on where i can look to check into this? I looked around his directory's but don't see anything jumping out at me.

    Maybe there is an command i can output to a file to make it easier to search? Could there be some massive logs taking up this space?
     
  2. germanos

    germanos Member

    Joined:
    Oct 11, 2005
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Hi Mitck,

    In root SSH access, the following commands will help to obtain this information:
    I´m found this in : [shell-fu:awk]$

    "This piece of code lists the size of every file and subdirectory of the current directory, much like du -sch ./* except the output is sorted by size, with larger files and directories at the end of the list. Useful to find where all that space goes."

    In home of your customer ( cd /home/username/ )

    Use:

    Code:
     du -sk ./* | sort -n | awk 'BEGIN{ pref[1]="K"; pref[2]="M"; pref[3]="G";} { total = total + $1; x = $1; y = 1; while( x > 1024 ) { x = (x + 1023)/1024; y++; } printf("%g%s\t%s\n",int(x*10)/10,pref[y],$2); } END { y = 1; while( total > 1024 ) { total = (total + 1023)/1024; y++; } printf("Total: %g%s\n",int(total*10)/10,pref[y]); } 

    This "piece of code" are very useful for me.

    Best Regards

    Germano
     
Loading...

Share This Page