IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 4, 2023, 8:18:25 AM (3 years ago)
Author:
eugene
Message:

allow long-running jobs (md5sum) to be remote; fix some error handling

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/eam/rawfix.20230221/src/check_md5s_dateobs.pl

    r42415 r42441  
    1212use Getopt::Long qw( GetOptions :config auto_help auto_version );
    1313
    14 # USAGE: check_md5s_dateobs.pl --dateobs (night)
     14# USAGE: check_md5s_dateobs.pl --dateobs (night) --topdir (topdir)
    1515
    16 my ($dateword) = &parse_cmdopts;
     16my ($dateword, $stage, $topdir) = &parse_cmdopts;
    1717
    18 my @instlist = glob ("$dateword/*.inst.txt");
    19 my @md5slist = glob ("$dateword/*.md5s.txt");
     18my @instlist = glob ("$topdir/$dateword/*.inst.$stage.txt");
     19my @md5slist = glob ("$topdir/$dateword/*.md5s.txt");
    2020
    2121my $Nfail = 0;
     
    2525    # find the matching md5sum file for this host
    2626
    27     my ($host) = $instfile =~ m|$dateword/([0-9a-zA-Z]*).inst.txt|;
     27    my ($host) = $instfile =~ m|$dateword/([0-9a-zA-Z]*).inst.$stage.txt|;
    2828    # print STDERR "host: $host\n";
    2929
     
    100100sub parse_cmdopts {
    101101
    102     my ($dateobs);
    103     GetOptions( 'dateobs=s' => \$dateobs) || pod2usage(2);
     102    my ($dateobs, $stage, $topdir);
     103    GetOptions( 'dateobs=s' => \$dateobs, 'topdir=s' => \$topdir, 'stage=s' => \$stage) || pod2usage(2);
    104104   
    105105    pod2usage( -msg => "Cannot determine target date, use --dateobs YYYY/MM/DD", -exitval => 2) unless defined $dateobs;
     106    pod2usage( -msg => "Specify the top-level output directory with --topdir", -exitval => 2) unless defined $topdir;
     107    pod2usage( -msg => "Define the stage (v0, v1, etc) with --stage", -exitval => 2) unless defined $stage;
    106108   
    107109    # check the date format (require YYYY/MM/DD and use that from 00:00:00 to 23:59:59 or take start and end?)
     
    115117    my $dateword = sprintf ("%4d%02d%02d", $date_year, $date_month, $date_day);
    116118
    117     return ($dateword);
     119    return ($dateword, $stage, $topdir);
    118120}
    119121
Note: See TracChangeset for help on using the changeset viewer.