Changeset 32265 for trunk/tools/diskspace/nebulous_wiki.pl
- Timestamp:
- Aug 31, 2011, 5:18:37 PM (15 years ago)
- File:
-
- 1 edited
-
trunk/tools/diskspace/nebulous_wiki.pl (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/diskspace/nebulous_wiki.pl
r32230 r32265 2 2 3 3 use DateTime; 4 $dt = DateTime->now; 4 use Getopt::Std; 5 use PS::IPP::Config; 5 6 6 7 7 @files = sort (<*.size.dat>); 8 $opt{S} = 0; 9 getopts('S',\%opt); 10 11 my $dt = DateTime->now; 12 13 my @lt = gmtime; 14 my $dt_data = DateTime->now; 15 $dt->subtract( days => $lt[6]); 16 my $datestring = $dt->ymd; 17 18 @files = sort ( split /\n/, `neb-ls -p neb:///ipp_diskspace/${datestring}/%neb_usage.dat`); 8 19 9 20 foreach $f (@files) { 10 21 $volume = $f; 11 $volume =~ s/.size.dat//; 22 $volume =~ s/.*://; 23 $volume =~ s/.neb_usage.dat//; 12 24 open(F,$f); 13 25 while(<F>) { … … 37 49 $presep = '||'; 38 50 39 print "${presep}Volume${sep}"; 40 foreach $w (sort (keys %sizes)) { 41 print "$w$sep"; 42 } 43 print "\n"; 44 foreach $v (sort (keys %sum)) { 45 print "${presep}${v}${sep}"; 51 if ($opt{S} == 0) { 52 print "${presep}Volume${sep}"; 46 53 foreach $w (sort (keys %sizes)) { 47 $val = $vol{$v}{$w} / 1024 / 1024 / 1024; 54 print "$w$sep"; 55 } 56 print "\n"; 57 foreach $v (sort (keys %sum)) { 58 print "${presep}${v}${sep}"; 59 foreach $w (sort (keys %sizes)) { 60 $val = $vol{$v}{$w} / 1024 / 1024 / 1024; 61 printf "%.2f%s",$val,$sep; 62 } 63 $val = $sum{$v} / 1024 / 1024 / 1024; 64 printf "%.2f%s",$val,$sep; 65 print "\n"; 66 } 67 $date = $dt->ymd; 68 print "${presep}${date}${sep}"; 69 foreach $w (sort (keys %sizes)) { 70 $val = $sizes{$w} / 1024 / 1024 / 1024; 48 71 printf "%.2f%s",$val,$sep; 49 72 } 50 $val = $sum{$v} / 1024 / 1024 / 1024;51 printf "%.2f%s",$val,$sep;52 73 print "\n"; 53 74 } 54 $date = $dt->ymd; 55 print "${presep}${date}${sep}"; 56 foreach $w (sort (keys %sizes)) { 57 $val = $sizes{$w} / 1024 / 1024 / 1024; 58 printf "%.2f%s",$val,$sep; 75 else { 76 my $ipprc = PS::IPP::Config->new("GPC1"); 77 my $nebcon = $ipprc->nebulous(); 78 79 my $outfile = "neb:///ipp_diskspace/${datestring}/summary.dat"; 80 my $out_fh; 81 if ($ipprc->file_exists($outfile)) { 82 my $S_file = $ipprc->file_resolve($outfile); 83 open($out_fh,">$S_file"); 84 } 85 else { 86 $out_fh = $ipprc->file_create_open($outfile); 87 } 88 foreach $w (sort (keys %sizes)) { 89 $val = $sizes{$w} / 1024 / 1024 / 1024; 90 print $out_fh "$w $val\n"; 91 } 92 close($out_fh); 59 93 } 60 print "\n";61 94 62 95
Note:
See TracChangeset
for help on using the changeset viewer.
