I have my server on Mediatemple and i reached my 20GB quota. I installed Ubuntu and many plugins but I don't know how I reached that 20GB? I'm running a website but I'm sure it is not taking all that space!
3 Answers
sudo du -x / | sort -n
will at least show you what's using space. As to whether it's legitimately using space or not is up to you to decide.
-
Oh that's much simpler than my method =)– user80776May 16, 2011 at 2:10
-
wow...i foudn out that all my space about 19gb is taken by logs files!!! apache/error.log is 17gb!!! should i delete them?? is it possible to set a purge weekly? May 16, 2011 at 2:17
-
1@camelCase, if you have that large of a error log file, maybe you want to investigate why you have so many errors, instead of just wiping it out... May 16, 2011 at 3:13
-
2@Holocryptic is correct, but once you have done that you really need to enable logrotate so that you don't have this happen again. It compresses older logs for space and can throw away logs after a window.– n8whnpMay 16, 2011 at 9:27
Shell in, cd to / and run
du -d 1 -h ./
(That will give you the total size of each directory).
CD to the largest directory and run the command again, rinse and repeat till you find all the big files =)
Edit:
The process might not have been 100% clear, when you run DU it'll give you a list of folders and their sizes like
2GB /foldera
1GB /folderb
[etc]
So in that case, CD into foldera and run the du command again, that'll give you the list of largest files/folders in there, keep drilling down till you find the largest files. If you don't need them, remove them.
If you have ssh-access and a linux box, you can easily graph your disk with baobab. This tool can also read remote folders via ssh and makes a circle diagram.
Also on my box du
has no -d
option and I use sudo du -h --max-depth=1 /
get an overview on command line.
-
Are you sure your version of
du
doesn't support depth limiting (the-d
option)?? I've never seen one that doesn't before; what OS are you running?– Chris SMay 18, 2011 at 3:33