IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 6, 2008, 2:33:18 PM (18 years ago)
Author:
jhoblitt
Message:

add a virtual "summary" volume to neb-d

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Nebulous/bin/neb-df

    r17454 r17547  
    33# Copyright (C) 2007  Joshua Hoblitt
    44#
    5 # $Id: neb-df,v 1.5 2008-04-18 03:12:25 jhoblitt Exp $
     5# $Id: neb-df,v 1.6 2008-05-07 00:33:18 jhoblitt Exp $
    66
    77use strict;
     
    4242print "Filesystem           1K-blocks      Used Available Use% Mounted on\n";
    4343
     44my $total_total = 0;
     45my $total_used  = 0;
    4446foreach my $row (@$stats) {
    4547    my %vol;
     
    4951    my $path        = $vol{path};
    5052    my $total       = $vol{total};
     53    $total_total    += $total;
    5154    my $used        = $vol{used};
     55    $total_used     += $used;
    5256    my $available   = $total - $used;
    5357    my $usedper     = ($used / $total) * 100;
     
    8084}
    8185
     86my $total_available   = $total_total - $total_used;
     87my $total_usedper     = ($total_used / $total_total) * 100;
     88
     89# summary
     90printf ("%s\n%20s", "/summmary_of_all_volumes", "");
     91printf(" %*s %*s %*s %*.0f%% %s\n",
     92        9,
     93        $total_total,
     94        9,
     95        $total_used,
     96        9,
     97        $total_available,
     98        3,
     99        $total_usedper,
     100        "/total",
     101    );
     102
    82103__END__
    83104
Note: See TracChangeset for help on using the changeset viewer.