Forum Moderators: phranque

Message Too Old, No Replies

Disk space left on server

how to check?

         

Natashka

7:41 am on Dec 5, 2002 (gmt 0)

10+ Year Member



Is there any simple script or, better, some online utility to find out how much disk space is left on a given server? I have a strong suspicion that my webhost's servers are booked up and one of my scripts is not working properly because of that (simply no space left for it to write), but my webhost not only wont solve the problem, but (much worse!) wont admit it.

Is there any simple and ACURATE way to check it out?

EliteWeb

7:50 am on Dec 5, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



UNIX, MAC, or WINDOWS?

Unix = access command line terminal and type 'df' once logged in.

Natashka

8:18 am on Dec 5, 2002 (gmt 0)

10+ Year Member



It's UNIX. Am I supposed to have a SSH to do that? I don't have a Shell access :(

Gorufu

9:21 am on Dec 5, 2002 (gmt 0)

10+ Year Member



Is there any simple script

Am I supposed to have a SSH to do that?

It would be an advantage to have shell access, however you may be able to check with a perl script. The following script should work.


#!/usr/bin/perl
print "Content-type: text/html\n\n";
print "<pre>\n";
system("/bin/df -h");
while (<>) { print; }
print "</pre>\n";
exit;

Run it from the cgi-bin
http: //mydomain.com/cgi-bin/script.pl

You should get output similar to the following. There may be less partitions. If Use% is 99% for a partition it is probably full


Filesystem Size Used Avail Use% Mounted on
/dev/hda2 100M 43M 54M 47% /boot
/dev/hda3 1.4G 98M 1.2G 7% /
/dev/hda4 41G 143M 39G 1% /home
/dev/hda5 7.7G 1.3G 6.0G 18% /usr
/dev/hda6 3.8G 87M 3.5G 3% /var
/dev/hdb1 73G 571M 69G 1% /home2

Natashka

10:08 am on Dec 5, 2002 (gmt 0)

10+ Year Member



Thank you very much, it helped a LOT! It shows 90% on /, (90 MB free) but I don't know how much was yesterday, maybe they've cleaned up some logs ;) Anyway, unacceptable for a paid host.

Thanks again!