View Full Version : space on server
Is there a way to tell how much space my web page takes up on the server. There are loads of grapics and I am just wondering how much space, I have left. Secondly, does my database count in that total? :)
If you have MySQL, your database counts against your disk usage.
Currently, there is no "official" way to tell how much of your 100MB you are using. I recommend that you download your entire webspace to a directory on your hard disk and see how much space that takes up. Because ascii files take up one less byte per line on Unix than on Windows, your usage against the 100MB may actually be a little less than you see on your local machine.
There is a unix command called "du" which is for disk usage. It takes a parameter which is the directory it should test, which is probably your home directory (/www/i/initial). If you pipe its output into sort -rn that will give you a list of your directories sorted with the largest direcctories at the top. I know we don't get telnet access, but if you can run a cgi script then you can have your script run this as a system command, saving the output to disk or feeding it back to your html response from the cgi script. Such output can be pretty ugly as your browser wraps everything into a single paragraph, but you can still read it fairly easily if you simply view the source html or reformat the output of the unix command a little.
In a perl script you can do something like this:
$q = `du | sort -rn`;
$q =~ s/\n/<BR>\n/g;
print "q: $q<p>";
You could also run a command like this from a cron job to have it record your disk usage each day at the time the job ran.
I'm not using MySQL right now so I don't know where that data is kept, but there might be ways to find out more about that as well.
If you're not familiar with unix I recommend taking the time to learn something about it. There are lots of tools for managing systems and automating processes. Good luck!
-JoKeR
vBulletin v3.6.0, Copyright ©2000-2009, Jelsoft Enterprises Ltd.