- Timestamp:
- Dec 22, 2019, 4:11:49 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ccl_branches/ipponly-20191108/ippScripts/scripts/minidvodb_createdb.pl
r38584 r41211 15 15 print "Starting script $0 on $host at $date\n\n"; 16 16 17 18 17 my $mjd_start = DateTime->now->mjd; # MJD of starting script 19 18 … … 39 38 } 40 39 41 my ( $outroot, $dbname, $dvodb, $minidvodb,$minidvodb_interval, $minidvodb_nums, $minidvodb_group, $ camera, $verbose, $no_update,40 my ( $outroot, $dbname, $dvodb, $minidvodb,$minidvodb_interval, $minidvodb_nums, $minidvodb_group, $minidvodb_host, $camera, $verbose, $no_update, 42 41 $no_op, $redirect, $save_temps); 43 42 GetOptions( 44 'camera|c=s' => \$camera, # Camera 45 'dbname|d=s' => \$dbname, # Database name 46 'minidvodb_group|w=s' => \$minidvodb_group, # minidvodb_group. 47 'outroot|w=s' => \$outroot, # output file base name 48 'dvodb|w=s' => \$dvodb, # output DVO database 49 'minidvodb|w=s' => \$minidvodb, # output miniDVODB 50 'interval|w=s' => \$minidvodb_interval, #interval between creation of minidvodbs (default = 1day) 51 'num|w=s' => \$minidvodb_nums, #interval between creation of minidvodbs (default = 500 addRuns) 52 'verbose' => \$verbose, # Print to stdout 53 'no-update' => \$no_update, # Update the database? 54 'no-op' => \$no_op, # Don't do any operations? 55 'redirect-output' => \$redirect, 56 'save-temps' => \$save_temps, # Save temporary files? 43 'camera|c=s' => \$camera, # Camera 44 'dbname|d=s' => \$dbname, # Database name 45 'minidvodb_group|w=s' => \$minidvodb_group, # minidvodb_group. 46 'outroot|w=s' => \$outroot, # output file base name 47 'dvodb|w=s' => \$dvodb, # output DVO database 48 'minidvodb|w=s' => \$minidvodb, # output miniDVODB 49 'interval|w=s' => \$minidvodb_interval, #interval between creation of minidvodbs (default = 1day) 50 'num|w=s' => \$minidvodb_nums, #interval between creation of minidvodbs (default = 500 addRuns) 51 'minidvodb_host|w=s' => \$minidvodb_host, #assign a hostname for addstar 52 'verbose' => \$verbose, # Print to stdout 53 'no-update' => \$no_update, # Update the database? 54 'no-op' => \$no_op, # Don't do any operations? 55 'redirect-output' => \$redirect, 56 'save-temps' => \$save_temps, # Save temporary files? 57 57 ) or pod2usage( 2 ); 58 58 … … 119 119 unless ($no_op) { 120 120 121 122 123 121 #see if there is already one in new state 124 122 my $fpaCommand1 = "$addtool -listminidvodbrun"; … … 127 125 $fpaCommand1 .= " -dbname $dbname" if defined $dbname; 128 126 129 130 127 unless ($no_update) { 131 128 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 132 129 run(command => $fpaCommand1, verbose => $verbose); 133 134 135 130 136 131 unless ($success) { … … 164 159 &my_die( "Unable to get listminidvodbrun",$minidvodb_group, $PS_EXIT_SYS_ERROR) unless $success2; 165 160 # if it didn't list something in active state (what?) then we definitely need to create a new one 166 if ( defined(@$stdout_buf2)) {161 if ((@$stdout_buf2)) { 167 162 my $metadata2 = $mdcParser->parse(join "", @$stdout_buf2) or 168 163 &my_die("Unable to parse metadata config", $minidvodb_group, $PS_EXIT_PROG_ERROR); … … 194 189 my ( $success3, $error_code3, $full_buf3, $stdout_buf3, $stderr_buf3 ) = 195 190 run(command => $fpaCommand3, verbose => $verbose); 196 &my_die( "Unable to get checkminidvodb unaddrun", $minidvodb_group, $PS_EXIT_SYS_ERROR) unless $success3;197 198 if ( defined(@$stdout_buf3)) { #checkminidvodb returns nothing IF there have been no addruns added to the db yet191 &my_die( "Unable to get checkminidvodbrunaddrun", $minidvodb_group, $PS_EXIT_SYS_ERROR) unless $success3; 192 193 if ((@$stdout_buf3)) { #checkminidvodb returns nothing IF there have been no addruns added to the db yet 199 194 my $metadata3 = $mdcParser->parse(join "", @$stdout_buf3) or 200 195 &my_die("Unable to parse metadata config", $minidvodb_group, $PS_EXIT_PROG_ERROR); … … 229 224 my $fpaCommand = "$addtool -addminidvodbrun"; 230 225 $fpaCommand .= " -set_minidvodb_group $minidvodb_group"; 226 $fpaCommand .= " -set_minidvodb_host $minidvodb_host"; 231 227 $fpaCommand .= " -set_minidvodb_path $minidvodbReal" if defined $minidvodbReal; 232 228 $fpaCommand .= " -dbname $dbname" if defined $dbname;
Note:
See TracChangeset
for help on using the changeset viewer.
