IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 30359


Ignore:
Timestamp:
Jan 25, 2011, 1:35:02 PM (15 years ago)
Author:
heather
Message:

whoops.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/heather/expbot.pl

    r30264 r30359  
    1111
    1212
    13 
     13use strict;
     14#use warnings;
    1415use DBI;
    1516use constant DB_SOCKET => '/var/run/mysqld/mysql.sock';
    16 
    17 
    18 my $date = "2011-01-11";
    19 
    20 
    21 
     17use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt );
     18use Pod::Usage qw( pod2usage );
     19
     20my $verbose;
     21my $date;
    2222my $dbname = 'gpc1';
    2323my $dbserver = 'ippdb01';
    2424my $dbuser = 'ipp';
    2525my $dbpass = 'ipp';
     26
     27
     28
     29
     30GetOptions(
     31           'start|s=s'    => \$date,
     32           'dbname|d'     => \$dbname,
     33           'verbose|v'    => \$verbose,
     34) or pod2usage( 0 );
     35pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
     36
     37if (!$date) {
     38    my ($sec, $min, $hour, $mday, $month, $year) = gmtime;
     39    $year += 1900;
     40    $month += 1;
     41    $date = sprintf "%4d-%02d-%02d", $year, $month, $mday;
     42}
    2643
    2744my $db = DBI->connect(
     
    4259my $stackq = "select exp_name, comment, rawExp.state, count(stack_id) from rawExp left join chipRun using (exp_id) left join camRun using (chip_id) left join fakeRun using (cam_id) left join warpRun using (fake_id) left join stackInputSkyfile using (warp_id) left join stackRun using (stack_id) where dateobs like '$date\%' and exp_type = 'OBJECT' group by exp_name;";
    4360
    44 #print $stackq;
     61
    4562print "stack\n";
    4663print `date`;
     
    5471}
    5572
    56 #my $diffq = "select exp_name, comment, rawExp.state, count(diff_id), diff_mode from rawExp left join chipRun using (exp_id) left join camRun using (chip_id) left join fakeRun using (cam_id) left join warpRun using (fake_id) join diffInputSkyfile on  warp_id = warp1 left join diffRun using (diff_id) where dateobs like '$date\%' and exp_type = 'OBJECT' group by exp_name;";
     73
    5774
    5875
     
    6077
    6178
    62 #print $diffq;
     79
    6380print "diff1\n";
    6481print `date`;
     
    193210foreach my $item (@{$dist5}) {
    194211    if (${$item}[3] > 0) {
    195         print "yy${$item}[4]xx\n";
     212        if (defined($diff_hashws{${$item}[0]})) {
     213            $dist5_hashws{${$item}[0]} = ${$item}[3];
     214        }
     215        else
     216        {
     217            $dist5_hash{${$item}[0]} = ${$item}[3];
     218        }
    196219       
    197        
    198         if (defined($diff_hashws{${$item}[0]})) { $dist5_hashws{${$item}[0]} = ${$item}[3]; }
    199 
    200         else
    201         {
    202            
    203             $dist5_hash{${$item}[0]} = ${$item}[3];
    204  
    205         }
    206 
    207220    }
    208221}
     
    257270}
    258271
    259 #print $warpq;
     272
    260273
    261274$db->disconnect();
Note: See TracChangeset for help on using the changeset viewer.