Changeset 26679
- Timestamp:
- Jan 25, 2010, 12:28:09 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/Nebulous/bin/neb-df (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Nebulous/bin/neb-df
r17547 r26679 44 44 my $total_total = 0; 45 45 my $total_used = 0; 46 my $allocated_total = 0; 47 my $allocated_used = 0; 46 48 foreach my $row (@$stats) { 47 49 my %vol; 48 @vol{qw(mountpoint total used vol_id name path allocate available xattr)}50 @vol{qw(mountpoint total used vol_id name host path allocate available xattr)} 49 51 = @$row; 50 51 my $path = $vol{path}; 52 my $path = $vol{host}; 52 53 my $total = $vol{total}; 53 54 $total_total += $total; … … 58 59 my $mountpoint = $vol{mountpoint}; 59 60 61 if ($vol{allocate} == 1) { 62 $allocated_total += $total; 63 $allocated_used += $used; 64 } 60 65 # indicated the part of the nebulous volume name that matches up with a 61 66 # local volume (mountpoint) … … 101 106 ); 102 107 108 my $allocated_available = $allocated_total - $allocated_used; 109 my $allocated_usedper = ($allocated_used / $allocated_total) * 100; 110 111 # summary 112 printf ("%s\n%20s", "/summmary_of_allocated_volumes", ""); 113 printf(" %*s %*s %*s %*.0f%% %s\n", 114 9, 115 $allocated_total, 116 9, 117 $allocated_used, 118 9, 119 $allocated_available, 120 3, 121 $allocated_usedper, 122 "/allocated", 123 ); 124 103 125 __END__ 104 126
Note:
See TracChangeset
for help on using the changeset viewer.
