IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 2, 2011, 2:46:41 PM (15 years ago)
Author:
watersc1
Message:

Add date options as needed. Handle non-nebulous space in a way that allows it to be accounted better.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/diskspace/nebulous_data.pl

    r32265 r32602  
    6161my $neb_dir = "/data/${neb}/nebulous/";
    6262
     63my $total_volume = 0;
     64my $used_volume  = 0;
     65open(DF,"df -B 1 /data/${neb}/ |") || die "Cannot run df\n";
     66while(<DF>) {
     67    chomp;
     68    if ($_ =~ /${neb}/) {
     69        $used_volume = (split /\s+/, $_)[2];
     70    }
     71}
     72close(DF);
     73
    6374open(FIND,"find $neb_dir -type f -printf \"%f %s\n\" |") || die "Cannot run find.\n";
     75
     76
    6477while (<FIND>) {
    6578    chomp;
     
    88101    $count{$stage}{$product} += 1;
    89102    $volume{$stage}{$product} += $size;
     103    $total_volume += $size;
    90104}
    91105close(FIND);
     106
    92107
    93108
     
    98113    }
    99114}
     115my $external_volume = $used_volume - $total_volume;
     116print $out_fh "EXTERNAL UNKNOWN 1 $external_volume\n";
    100117
    101118close($out_fh);
Note: See TracChangeset for help on using the changeset viewer.