Hugeusrealus has asked for the wisdom of the Perl Monks concerning the following question:
PS I have tried to comment out line line 6 my $pass = $query->param('pass'); but then the script just hangs.... So what is wrong with my new CGI (line 5).#!/usr/bin/perl print "Content-Type: text/html\n\n"; use CGI; my $query = new CGI; my $pass = $query->param('pass'); if ($pass ne 'Tn9SG0s') { exit; } $path = "/home/httpd/$site/html/"; use File::Find; my @sites = ("xyz-site/xyz-site-directory", "xyz-site2/xyz-site-directory2" ); push(@sites, '/home/tomato/', #put any other directories in here ); foreach my $site (@sites) { $sizeb = 0; $path = "/home/httpd/$site" if $site !~ m!^/!; $path = "$site" if $site =~ m!^/!; #$path = "/home/stanley/"; $file = 0; &find ( sub { $sizeb += -s }, "$path"); &find ( sub { $file += 1 }, "$path"); my $sizekb = int ($sizeb / 1024); my $sizemb = int ($sizekb / 1024); print qq(<h4> $site </h4>); print " Files $file <br>"; print " bytes $sizeb <br>"; print "Kbytes $sizekb <br>"; print " mbytes $sizemb <br>"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
You're kidding, right?
by tmoertel (Chaplain) on Sep 17, 2004 at 05:32 UTC | |
|
Re: Disc Space checking
by jZed (Prior) on Sep 17, 2004 at 05:36 UTC | |
by Hugeusrealus (Initiate) on Sep 17, 2004 at 05:39 UTC | |
|
Re: Disc Space checking
by PodMaster (Abbot) on Sep 17, 2004 at 05:31 UTC | |
|
Re: Disc Space checking
by tachyon (Chancellor) on Sep 17, 2004 at 05:47 UTC | |
by gaal (Parson) on Sep 17, 2004 at 08:49 UTC | |
by tachyon (Chancellor) on Sep 19, 2004 at 04:27 UTC | |
by gaal (Parson) on Sep 19, 2004 at 08:43 UTC |