IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 7, 2009, 12:45:24 PM (17 years ago)
Author:
eugene
Message:

update from mainline

Location:
branches/eam_branches/20090715
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/20090715

  • branches/eam_branches/20090715/pstamp/scripts/pstamp_parser_run.pl

    r21410 r25022  
    1313use Getopt::Long qw( GetOptions );
    1414use File::Basename qw( basename dirname);
     15use POSIX qw( strftime );
    1516
    1617my $req_id;
     
    2021my $verbose;
    2122my $dbname;
     23my $dbserver;
    2224
    2325GetOptions(
     
    2830    'verbose'           =>  \$verbose,
    2931    'dbname=s'          =>  \$dbname,
     32    'dbserver=s'         =>  \$dbserver,
    3033);
    3134
     
    6871exit ($PS_EXIT_CONFIG_ERROR) unless defined $pstamp_workdir; # lookup failure outputs a message
    6972
    70 # workdir is where we download request files to and place any error output from the parser
     73if (!$dbserver) {
     74    $dbserver =  metadataLookupStr($ipprc->{_siteConfig}, 'PS_DBSERVER');
     75}
     76
     77# workdir is where all of the files generated for this request are placed
    7178# NOTE: this location needs to be kept in sync with the web interface ( request.php )
    72 my $workdir = "$pstamp_workdir/$req_id";
    73 
     79my $datestr = strftime "%Y%m%d", gmtime;
     80my $datedir = "$pstamp_workdir/$datestr";
     81if (! -e $datedir ) {
     82    mkdir $datedir or die "failed to create working directory $datedir for request id $req_id";
     83}
     84
     85my $workdir = "$datedir/$req_id";
    7486if (! -e $workdir ) {
    7587    mkdir $workdir or die "failed to create working directory $workdir for request id $req_id";
     
    167179    $command   .= " -fault $PS_EXIT_DATA_ERROR";
    168180    $command   .= " -dbname $dbname" if $dbname;
     181    $command   .= " -dbserver $dbserver" if $dbserver;
    169182    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    170183        run(command => $command, verbose => $verbose);
     
    177190$parse_cmd .= " --mode queue_job --req_id $req_id --product $product --out_dir $workdir --file $uri";
    178191$parse_cmd .= " --dbname $dbname" if $dbname;
     192$parse_cmd .= " --dbserver $dbserver" if $dbserver;
    179193$parse_cmd .= " --verbose" if $verbose;
    180194
     
    218232    $command   .= " -fault $fault" if $fault;
    219233    $command   .= " -dbname $dbname" if $dbname;
     234    $command   .= " -dbserver $dbserver" if $dbserver;
    220235    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    221236        run(command => $command, verbose => $verbose);
Note: See TracChangeset for help on using the changeset viewer.