Changeset 25027 for branches/pap/pstamp/scripts/pstamp_parser_run.pl
- Timestamp:
- Aug 7, 2009, 4:08:25 PM (17 years ago)
- Location:
- branches/pap
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
pstamp/scripts/pstamp_parser_run.pl (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/pap
- Property svn:mergeinfo changed
-
branches/pap/pstamp/scripts/pstamp_parser_run.pl
r21410 r25027 13 13 use Getopt::Long qw( GetOptions ); 14 14 use File::Basename qw( basename dirname); 15 use POSIX qw( strftime ); 15 16 16 17 my $req_id; … … 20 21 my $verbose; 21 22 my $dbname; 23 my $dbserver; 22 24 23 25 GetOptions( … … 28 30 'verbose' => \$verbose, 29 31 'dbname=s' => \$dbname, 32 'dbserver=s' => \$dbserver, 30 33 ); 31 34 … … 68 71 exit ($PS_EXIT_CONFIG_ERROR) unless defined $pstamp_workdir; # lookup failure outputs a message 69 72 70 # workdir is where we download request files to and place any error output from the parser 73 if (!$dbserver) { 74 $dbserver = metadataLookupStr($ipprc->{_siteConfig}, 'PS_DBSERVER'); 75 } 76 77 # workdir is where all of the files generated for this request are placed 71 78 # NOTE: this location needs to be kept in sync with the web interface ( request.php ) 72 my $workdir = "$pstamp_workdir/$req_id"; 73 79 my $datestr = strftime "%Y%m%d", gmtime; 80 my $datedir = "$pstamp_workdir/$datestr"; 81 if (! -e $datedir ) { 82 mkdir $datedir or die "failed to create working directory $datedir for request id $req_id"; 83 } 84 85 my $workdir = "$datedir/$req_id"; 74 86 if (! -e $workdir ) { 75 87 mkdir $workdir or die "failed to create working directory $workdir for request id $req_id"; … … 167 179 $command .= " -fault $PS_EXIT_DATA_ERROR"; 168 180 $command .= " -dbname $dbname" if $dbname; 181 $command .= " -dbserver $dbserver" if $dbserver; 169 182 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 170 183 run(command => $command, verbose => $verbose); … … 177 190 $parse_cmd .= " --mode queue_job --req_id $req_id --product $product --out_dir $workdir --file $uri"; 178 191 $parse_cmd .= " --dbname $dbname" if $dbname; 192 $parse_cmd .= " --dbserver $dbserver" if $dbserver; 179 193 $parse_cmd .= " --verbose" if $verbose; 180 194 … … 218 232 $command .= " -fault $fault" if $fault; 219 233 $command .= " -dbname $dbname" if $dbname; 234 $command .= " -dbserver $dbserver" if $dbserver; 220 235 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 221 236 run(command => $command, verbose => $verbose);
Note:
See TracChangeset
for help on using the changeset viewer.
