IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 35914


Ignore:
Timestamp:
Aug 8, 2013, 10:57:14 AM (13 years ago)
Author:
bills
Message:

take workdir as argument

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tags/ipp-20130712/pstamp/scripts/pstamp_server_status

    r35913 r35914  
    1515
    1616
    17 my ($rundir, $verbose, $save_temps);
     17my ($rundir, $workdir, $verbose, $save_temps);
    1818my $br = '<br />';
    1919
    2020GetOptions(
    2121    'rundir=s'      => \$rundir,
     22    'workdir=s'     => \$workdir,
    2223    'verbose'       => \$verbose,
    2324    'save-temps'    => \$save_temps,
     
    155156    }
    156157}
    157 {
     158if ($workdir) {
    158159    # get the space available in the working directory file system
    159     my $df_output = `df -h .`;
     160    my $df_output = `df -h $workdir`;
    160161    my @lines = split "\n", $df_output;
    161     if (scalar @lines == 2) {
    162         my ($total, $used, $free, $percent, $part) = split " ", $lines[1];
    163         print "<br><b>Working Directory:</b> $percent $free free out of $total total<br>\n";
    164     } else {
    165         print "<br>\n";
    166         print "unexpected output from df:\n$df_output\n";
     162    foreach my $line (@lines) {
     163        next unless $line =~ /data/;
     164        # if (scalar @lines == 2) {
     165        if (1) {
     166            my ($total, $used, $free, $percent, $part) = split " ", $line;
     167            print "<br><b>Working Directory:</b> $percent free: $free out of $total total<br>\n";
     168        } else {
     169            print "<br>\n";
     170            print "unexpected output from df:\n$df_output\n";
     171        }
    167172    }
    168173
Note: See TracChangeset for help on using the changeset viewer.