IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 6, 2009, 5:44:55 PM (17 years ago)
Author:
bills
Message:

Create stamps in workdir area instead of the data store product directory
various changes to improve logging

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/pstamp/scripts/request_finish.pl

    r19221 r21410  
    1313use File::Temp qw( tempfile );
    1414use File::Copy;
     15use File::Basename qw( dirname );
    1516
    1617use PS::IPP::Metadata::Config;
     
    2021use PS::IPP::Config qw( :standard );
    2122
    22 my ( $req_id, $req_name, $req_file, $req_type, $product, $dbname, $verbose, $save_temps );
     23my ( $req_id, $req_name, $req_file, $req_type, $out_dir, $product, $dbname, $verbose, $save_temps, $redirect_output );
    2324
    2425GetOptions(
     
    2728           'req_file=s' => \$req_file,
    2829           'req_type=s' => \$req_type,
     30           'out_dir=s'  => \$out_dir,
    2931           'product=s'  => \$product,
    3032           'dbname=s'   => \$dbname,
    3133           'verbose'    => \$verbose,
    3234           'save-temps' => \$save_temps,
     35           'redirect-output' => \$redirect_output,
    3336) or pod2usage( 2 );
    3437
     
    4245$err .= "--req_name is required\n" if !$req_name;
    4346$err .= "--product is required\n" if !$product;
     47# $err .= "--out_dir is required\n" if !$out_dir;
    4448
    4549die "$err" if $err;
     50
     51
     52if (!$out_dir) {
     53    $out_dir = dirname($req_file);
     54}
     55
     56if ($redirect_output) {
     57    my $logDest = "$out_dir/reqfinish.$req_id.log";
     58    my $ipprc = PS::IPP::Config->new();
     59    $ipprc->redirect_output($logDest);
     60}
    4661
    4762my $missing_tools;
     
    6378}
    6479if ($finish_cmd) {
    65     my $command = $finish_cmd . " --req_id $req_id --req_name $req_name --req_file $req_file --product $product";
     80    my $command = $finish_cmd . " --req_id $req_id --req_name $req_name --req_file $req_file --product $product --out_dir $out_dir";
    6681    $command   .= " --dbname $dbname" if $dbname;
    6782    $command   .= " --verbose" if $verbose;
Note: See TracChangeset for help on using the changeset viewer.