FutureQuest, Inc. FutureQuest, Inc. FutureQuest, Inc.

FutureQuest, Inc.
Go Back   FutureQuest Community > General Site Owner Support (All may read/respond) > General Coding/Development
User Name
Password  Lost PW

Reply
 
Thread Tools Search this Thread Display Modes
Old 04-07-1999, 01:47 PM   Postid: 18427
Dean B
Site Owner
 
Dean B's Avatar

Forum Notability:
10 pts: User-friendly
[Post Feedback]
 
Join Date: Jan 1999
Location: U.K
Posts: 480
Forum disk space PL

Terra,
Do you think if I asked you nicely you'd divulge the contents of ubbDU.pl ? I'd really like to be able to use it on some of my intended sites.

Thx, Dean.
Dean B is offline   Reply With Quote
Old 04-07-1999, 02:11 PM   Postid: 18428
 Deb
FutureQuest, Inc.
 
Deb's Avatar
 
Join Date: Jun 1998
Location: Franktown Colorado
Posts: 6,781

ftp://ftp.aota.net/ubbDS.zip


Deb
Deb is offline   Reply With Quote
Old 04-07-1999, 02:53 PM   Postid: 18429
Dean B
Site Owner
 
Dean B's Avatar

Forum Notability:
10 pts: User-friendly
[Post Feedback]
 
Join Date: Jan 1999
Location: U.K
Posts: 480
<-- adds Deb to XMas card list

Thx.
Dean B is offline   Reply With Quote
Old 04-07-1999, 03:58 PM   Postid: 18430
Dean B
Site Owner
 
Dean B's Avatar

Forum Notability:
10 pts: User-friendly
[Post Feedback]
 
Join Date: Jan 1999
Location: U.K
Posts: 480
Deb,
That was straightforward enough but am I right in thinking that it only totals the space used for the UBB dir and dirs below it. It doesn't total the files in the UBB's cgi-bin, as in this case /big/dom/xdmcity/cgi-bin/ubb ?

Dean.
Dean B is offline   Reply With Quote
Old 04-07-1999, 04:43 PM   Postid: 18431
Justin
Visitor
 
Justin's Avatar

Forum Notability:
0 pts:
[Post Feedback]
 
Join Date: Jan 1999
Location: Kissimmee, FL
Posts: 3,672
How hard could that be to modify? Besides, the cgi stuff is probably less than 100k, negligable compared to 20 megs or so (haven't looked in a while ) Either way, you could just add to it, make it check both dir's and add them up

------------------
Justin Nelson
FutureQuest Support



Justin is offline   Reply With Quote
Old 04-08-1999, 09:06 AM   Postid: 18432
Dean B
Site Owner
 
Dean B's Avatar

Forum Notability:
10 pts: User-friendly
[Post Feedback]
 
Join Date: Jan 1999
Location: U.K
Posts: 480
To FQ Techie Team

I amended this line -
$du = `/usr/bin/du -hs /big/dom/xdmcity/www/ubb`;

to this -
$du = (`/usr/bin/du -hs /big/dom/xdmcity/www/ubb`) + (`/usr/bin/du -hs /big/dom/xdmcity/cgi-bin/ubb`);

and it appears to work ok (lucks obviously with me today ) but I lost the 'k' at the end of the total. I'm assuming this is because it went over 1000k. I simply added a 'k' in the print line to put it back (although there's now a space between the digits and the 'k').Is it possible to force it to display in MB when it gets over 1000k ? It currently shows 1267 k, could that be rounded off to show 1.3MB or is it not worth the hassle ?
It's here - http://www.dmcity.com/cgi-bin/ubb/ubbDS.pl

Dean.
ps. Justin, the scripts themselves total 623k !

[This message has been edited by Dean B (edited 04-08-99).]
Dean B is offline   Reply With Quote
Old 04-08-1999, 09:59 AM   Postid: 18433
Paul
Visitor
 
Paul's Avatar

Forum Notability:
0 pts:
[Post Feedback]
 
Join Date: Dec 1998
Location: Near Daytona Beach USA
Posts: 406
Hey. I like that!... but mine prints out like this:
The current disk space used by the Forums is: 810.4
Is there a way to fix this?

Thanks..
--------
Paul
Paul is offline   Reply With Quote
Old 04-08-1999, 10:07 AM   Postid: 18434
Dean B
Site Owner
 
Dean B's Avatar

Forum Notability:
10 pts: User-friendly
[Post Feedback]
 
Join Date: Jan 1999
Location: U.K
Posts: 480
Hey Paul... I do hope that's 'k' and not 'mb'
Dean B is offline   Reply With Quote
Old 04-08-1999, 08:31 PM   Postid: 18435
 Terra
CTO FutureQuest, Inc.
 
Terra's Avatar
 
Join Date: Jun 1998
Location: Z'ha'dum
Posts: 7,672
When I wrote it for AOTA, it was quick'n'dirty...

Here is a megafy routine that I wrote for the Disk_Space CNC module...

I'm sure you'll know where to use it...

sub megafy {
my $num = shift;
my $kb = 1024;
my $mb = $kb ** 2;

#Mega routine
if ($num >= $mb) {
return sprintf('%.2f Mb', $num/$mb);
}
else {
return sprintf('%.2f kb', $num/$kb);
}
}

Just plug this in and juice it up...

--
Terra
--Unsung hero--
FutureQuest
Terra is offline   Reply With Quote
Old 04-08-1999, 08:33 PM   Postid: 18436
 Terra
CTO FutureQuest, Inc.
 
Terra's Avatar
 
Join Date: Jun 1998
Location: Z'ha'dum
Posts: 7,672
Here is a commify subroutine as well...

sub commify {
local $_ = shift;
1 while s/^(-?\d+)(\d{3})/$1,$2/;
return $_;
}

--
Terra
--Do you want coffee with your sugar and cream?--
FutureQuest
Terra is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 visitors)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 07:32 PM.


Running on vBulletin®
Copyright © 2000 - 2013, Jelsoft Enterprises Ltd.
Hosted & Administrated by FutureQuest, Inc.
Images & content copyright © 1998-2013 FutureQuest, Inc.
FutureQuest, Inc.