IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 22, 2019, 4:11:49 PM (7 years ago)
Author:
cclin33
Message:

update addstar for multiple hosts

Location:
branches/ccl_branches/ipponly-20191108/ippScripts/scripts
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/ccl_branches/ipponly-20191108/ippScripts/scripts/addstar_run.pl

    r40803 r41211  
    4444my $minidvodb_path;
    4545
    46 my ( $add_id, $camera, $stage, $stage_id, $stage_extra1, $outroot, $stageroot, $dbname, $reduction, $dvodb, $minidvodb, $minidvodb_name, $minidvodb_group, $image_only, $verbose, $no_update,
    47      $no_op, $redirect, $save_temps);
     46my ( $add_id, $camera, $stage, $stage_id, $stage_extra1, $outroot, $stageroot, $dbname, $reduction,
     47     $dvodb, $minidvodb, $minidvodb_name, $minidvodb_group, $minidvodb_host, $image_only, $verbose,
     48     $no_update, $no_op, $redirect, $save_temps, $dvodbhost);
    4849GetOptions(
    4950    'add_id=s'          => \$add_id, # Camtool identifier
     
    6667    'redirect-output'   => \$redirect,
    6768    'save-temps'        => \$save_temps, # Save temporary files?
     69    'dvodbhost|w=s' => \$dvodbhost, # miniDVO database group
    6870    ) or pod2usage( 2 );
    6971
    7072pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
    7173pod2usage(
    72           -msg => "Required options: --add_id --camera --outroot --dvodb --stageroot --stage --dbname",
     74          -msg => "Required options: --add_id --camera --outroot --dvodb --stageroot --stage --dbname --dvodbhost",
    7375          -exitval => 3,
    7476          ) unless
     
    7981    defined $dvodb and
    8082    defined $dbname and
     83    defined $dvodbhost and
    8184    defined $camera;
    8285if ($stage =~ /cam/ && !defined $stage_id) {
     
    297300        $minidvodb_path = $comp->{minidvodb_path};
    298301        $minidvodb_name = $comp->{minidvodb_name};
     302        $minidvodb_host = $comp->{minidvodb_host};
    299303       
    300304        if (!defined($minidvodb_path)) {
     
    422426$fpaCommand .= " -dvodb_path $minidvodb_path" if defined $minidvodb_path;
    423427$fpaCommand .= " -minidvodb_name $minidvodb_name" if defined $minidvodb_name;
     428$fpaCommand .= " -minidvodb_host $dvodbhost" if defined $dvodbhost;
    424429$fpaCommand .= " -dbname $dbname" if defined $dbname;
    425430
     
    458463        $command .= " -path_base $outroot" if defined $outroot;
    459464        $command .= (" -dtime_addstar " . ((DateTime->now->mjd - $mjd_start) * 86400));
    460    #     $command .= " -minidvodb_name $minidvodb_name" if defined $minidvodb_name; don't think we want it recorded (not sure)
     465        $command .= " -minidvodb_name $minidvodb_name" if defined $minidvodb_name; # dont think we want it recorded (not sure)
     466        $command .= " -minidvodb_host $dvodbhost" if defined $dvodbhost; # dont think we want it recorded (not sure)
    461467        $command .= " -stage_extra1 $stage_extra1" if defined $stage_extra1;
    462468        $command .= " -dbname $dbname" if defined $dbname;
  • branches/ccl_branches/ipponly-20191108/ippScripts/scripts/minidvodb_createdb.pl

    r38584 r41211  
    1515print "Starting script $0 on $host at $date\n\n";
    1616
    17 
    1817my $mjd_start = DateTime->now->mjd;   # MJD of starting script
    1918
     
    3938}
    4039
    41 my (  $outroot, $dbname, $dvodb, $minidvodb,$minidvodb_interval, $minidvodb_nums, $minidvodb_group, $camera,  $verbose, $no_update,
     40my (  $outroot, $dbname, $dvodb, $minidvodb,$minidvodb_interval, $minidvodb_nums, $minidvodb_group, $minidvodb_host, $camera,  $verbose, $no_update,
    4241     $no_op, $redirect, $save_temps);
    4342GetOptions(
    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?
    5757    ) or pod2usage( 2 );
    5858
     
    119119unless ($no_op) {
    120120
    121 
    122 
    123121#see if there is already one in new state
    124122    my $fpaCommand1 = "$addtool -listminidvodbrun";
     
    127125    $fpaCommand1 .= " -dbname $dbname" if defined $dbname;
    128126
    129 
    130127unless ($no_update) {
    131128    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    132129        run(command => $fpaCommand1, verbose => $verbose);
    133 
    134 
    135130
    136131   unless ($success) {
     
    164159    &my_die( "Unable to get listminidvodbrun",$minidvodb_group, $PS_EXIT_SYS_ERROR) unless $success2;
    165160  # 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)) {
    167162  my  $metadata2 = $mdcParser->parse(join "", @$stdout_buf2) or
    168163        &my_die("Unable to parse metadata config", $minidvodb_group, $PS_EXIT_PROG_ERROR);
     
    194189my ( $success3, $error_code3, $full_buf3, $stdout_buf3, $stderr_buf3 ) =
    195190        run(command => $fpaCommand3, verbose => $verbose);
    196     &my_die( "Unable to get checkminidvodbunaddrun", $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 yet
     191    &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
    199194    my  $metadata3 = $mdcParser->parse(join "", @$stdout_buf3) or
    200195        &my_die("Unable to parse metadata config", $minidvodb_group, $PS_EXIT_PROG_ERROR);
     
    229224    my $fpaCommand = "$addtool -addminidvodbrun";
    230225    $fpaCommand .= " -set_minidvodb_group $minidvodb_group";
     226    $fpaCommand .= " -set_minidvodb_host $minidvodb_host";
    231227    $fpaCommand .= " -set_minidvodb_path  $minidvodbReal" if defined $minidvodbReal;
    232228    $fpaCommand .= " -dbname $dbname" if defined $dbname;
Note: See TracChangeset for help on using the changeset viewer.