🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.cray
Article #9

Re: amd/df/du for cray?

#9
From: Jeff Bauer
Date: Wed, 04 Nov 1992 17:52
81 lines
2645 bytes
In article <TPAQUETTE.92Nov3160731@gumby.ita.lgc.com> tpaquette@ita.lgc.com (Trevor Paquette) writes:
>
>  The subject says it. Has anyone ported AMD (The Berkely 4.4 Automounter)
> to the Cray?
>  Also how about a df/du that reports Kbytes free/used and not blocks?
>
>  Trev
>--
>Name : Trevor Paquette       | Landmark/ITA             |   _\___ Fahrvergnugen
>Email: tpaquette@ita.lgc.com | Calgary, Alberta, Canada |  /     \____         
>Visitor from CyberSpace      | (403) 269-4669           | / G60       \        
>Renegade of Virtual Reality  | #include <disclaimer.h>  | \-O------O--/        

Can't help you with the first, but here's a shell script I have that
solves half of the second problem (for "df") :

-- cut here --
#!/bin/sh
echo "Mount Point         Mbytes      Used     Avail   Full"
/bin/df -t | awk '
BEGIN {
	mbtt = mbat = 0;
	nfsline = 0;
}
{ 
	if ($1 ~ /\//) {
	  lineno = 1;
	}
	if (nfsline == 1) {
	  printf("this should be NFS blks avail : %d\n",$1);
	  mba = $1/1024;
	  mbat += mba;
	  lineno = 2;
	}
	else if (lineno == 1) {
	  if ($2 ~ /:/) {
	    mp = $1;
	    nfsline = 1;
	  }
	  else {
	    mp = $1;
	    if (length($3) > 3) {
	      mba = (int(substr($3,index($3,":")+1)))/256;
	    }
	    else {
	      mba = $4/256;
	    }
	    mbat += mba;
	    lineno = 2;
	  }
	}
	else if (lineno == 2) {
	  if ((nfsline == 1) || (NF < 6)) {
	    ind = index($1, ":");
	    mbt = (int(substr($1,ind+1,7)))/256;
	  }
	  else {
	    if (NF > 3) {
	      mbt = $2/256;
	    }
	    else {
	      mbt = (int(substr($1,index($1,":")+1)))/256;
	    }
	  }
	  mbtt += mbt;
	  lineno = 0;
	  printf("%-17s %9.3f %9.3f %9.3f %6.3f%%\n",\
	    mp,mbt,mbt-mba,mba,((mbt-mba)/mbt)*100)
	}
	if (nfsline == 1) nfsline = 0;

}
END {
	printf("-------------------------------------------------------\n");
	printf("TOTALS\t\t  %9.3f %9.3f %9.3f %6.3f%%\n",\
	  mbtt,(mbtt-mbat),mbat,((mbtt-mbat)/mbtt)*100);

}'
--
Jeff Bauer				   jtbauer@acns.fsu.edu
FSU Academic Computing & Network Services  (904) 644-2591 x. 131
Technical Details
Message-ID: <1992Nov4.175255.22126@mailer.cc.fsu.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!europa.asd.contel.com!gatech!mailer.cc.fsu.edu!loligo!bauer
References: <TPAQUETTE.92Nov3160731@gumby.ita.lgc.com>

Show Full Headers
Complete Article Headers
Newsgroups: comp.unix.cray,comp.sources.wanted,alt.sources.wanted
Path: arc1-ca.pugleaf.net!sparky!uunet!europa.asd.contel.com!gatech!mailer.cc.fsu.edu!loligo!bauer
From: bauer@loligo.cc.fsu.edu (Jeff Bauer)
Subject: Re: amd/df/du for cray?
Message-ID: <1992Nov4.175255.22126@mailer.cc.fsu.edu>
Sender: news@mailer.cc.fsu.edu (Usenet News File Owner)
Nntp-Posting-Host: loligo.cc.fsu.edu
Organization: Florida State University Computing Center
References: <TPAQUETTE.92Nov3160731@gumby.ita.lgc.com>
Date: Wed, 4 Nov 92 17:52:55 GMT
Lines: 81