Changeset 40476
- Timestamp:
- Jun 27, 2018, 3:17:00 PM (8 years ago)
- Location:
- branches/czw_branch/20170908/tools
- Files:
-
- 4 edited
- 2 copied
-
. (modified) (1 prop)
-
diskspace/rework/result2size.pl (modified) (2 diffs)
-
fix.ws.nightlyscience (copied) (copied from trunk/tools/fix.ws.nightlyscience )
-
regpeek.pl (modified) (2 diffs)
-
seed_summitExp.pl (copied) (copied from trunk/tools/seed_summitExp.pl )
-
stsci_disks/p4_restore.pl (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/czw_branch/20170908/tools
-
Property svn:mergeinfo
set to
/branches/czw_branch/20160809/tools merged eligible /trunk/tools merged eligible
-
Property svn:mergeinfo
set to
-
branches/czw_branch/20170908/tools/diskspace/rework/result2size.pl
r38749 r40476 1 #! /usr/local/bin/perl -w1 #!/usr/bin/perl -w 2 2 3 3 my %sizes = ( … … 114 114 %counts_full = (); 115 115 %counts_total = (); 116 117 foreach my $stage_name ('raw','chip','chip_lies','cam','warp','warp_lies','diff','diff_lies','stack','ssky','skycal','ff') { 118 $sums{$stage_name} = 0; 119 $counts_full{$stage_name} = 0; 120 $counts_total{$stage_name} = 0; 121 } 122 116 123 while (<>) { 117 124 chomp; -
branches/czw_branch/20170908/tools/regpeek.pl
r34018 r40476 21 21 } 22 22 print "Date: $date\n"; 23 print "CMD: regtool -checkstatus -date $date -class_id ota33 -dbname gpc1-simple\n";24 chomp(my $bad_exp = `regtool -checkstatus -date $date -class_id ota33 -dbname gpc1-simple | grep 'stop run' | head -1`);23 print "CMD: regtool -checkstatus -date $date -class_id ota33 -dbname $dbname -simple\n"; 24 chomp(my $bad_exp = `regtool -checkstatus -date $date -class_id ota33 -dbname $dbname -simple | grep 'stop run' | head -1`); 25 25 my @row = split /\s+/, $bad_exp; 26 26 if ($#row == 18) { … … 49 49 print "$exp_name $class_id $bt_state $data_state $uri\t"; 50 50 if (($bt_state > -10)&&($data_state eq 'check_burntool')) { 51 print "#??? regtool -updateprocessedimfile -exp_id $exp_id -class_id $class_id -set_state pending_burntool -dbname gpc1";51 print "#??? regtool -updateprocessedimfile -exp_id $exp_id -class_id $class_id -set_state pending_burntool -dbname $dbname"; 52 52 } 53 53 print "\n"; -
branches/czw_branch/20170908/tools/stsci_disks/p4_restore.pl
r38684 r40476 29 29 30 30 my ( $db, $dbhost, $dbpass, $dbuser); 31 my $conffile = "/home/panstarrs/ipp/ippconfig/nebulous.config"; 31 #my $conffile = "/home/panstarrs/ipp/ippconfig/nebulous.config"; 32 my $conffile = '/data/ippc64.1/ippitc/ippconfig/nebulous.config'; 33 32 34 if (-e $conffile) { 33 35 # printf STDERR "found config\n"; … … 53 55 54 56 pod2usage( -msg => "Cannot configure nebulous database", -exitval => 2) unless 55 defined $host && defined $volume && defined $dir && 57 defined $host && defined $volume && defined $dir && 56 58 defined $db && defined $dbhost && defined $dbuser && defined $dbpass; 57 59 … … 71 73 my $time = time(); 72 74 73 my $dbh = DBI->connect( 74 "DBI:mysql:database=$db:host=$dbhost", 75 $dbuser, 76 $dbpass, 77 { 78 RaiseError => 1, 79 PrintError => 0, 80 AutoCommit => 1, 81 }, 82 ); 75 76 #$dbhost = '166.122.172.39'; 77 #my $dbport = '3308'; 78 #my $dbh = DBI->connect( 79 # "DBI:mysql:database=$db:host=$dbhost:port=$dbport", 80 # $dbuser, 81 # $dbpass, 82 # { 83 # RaiseError => 1, 84 # PrintError => 0, 85 # AutoCommit => 1, 86 # }, 87 # ); 88 use constant DB_SOCKET => '/var/run/mysqld/mysqld.sock'; 89 90 my $dbh = DBI->connect("DBI:mysql:database=${db};host=${dbhost};" . 91 "mysql_socket=" . DB_SOCKET(), 92 ${dbuser},${dbpass}, 93 { RaiseError => 1, AutoCommit => 1} 94 ) or die "Unable to connect to database $DBI::errstr\n"; 83 95 84 96 85 my $logDest = "neb://any/stsci_shuffle/restore/${host}.${volume}/${source}.${volume}/${dir}.log.${time}"; 97 my $logDest = "/export/${host}.${volume}/retire_rsync/restore/${host}.${volume}/${source}.${volume}/${dir}.log.${time}"; 98 99 #if ((${host} eq 'ippb04')&&($volume == 2)) { 100 # $logDest = "/export/${host}.0/stsci_shuffle/restore/${host}.${volume}/${source}.${volume}/${dir}.log.${time}"; 101 #} 102 86 103 my $ipprc = PS::IPP::Config->new( "GPC1" ) or die "Could not create config object.\n"; 87 104 $ipprc->redirect_output($logDest) or die "Could not redirect output to logfile ${logDest}\n"; 88 105 89 my $root = "/export/${host}.${volume}/ stsci_shuffle/${source}.${source_vol}/nebulous/${dir}";106 my $root = "/export/${host}.${volume}/retire_rsync/data/${source}.${source_vol}/nebulous/${dir}"; 90 107 my @subdirectories = <$root/*>; 91 108 … … 113 130 114 131 my $destination_subdir = $subdir; 115 $destination_subdir =~ s%/ stsci_shuffle/${source}.${source_vol}/nebulous%/nebulous%;132 $destination_subdir =~ s%/retire_rsync/data/${source}.${source_vol}/nebulous%/nebulous%; 116 133 117 134 my @files = <${subdir}/*>; … … 121 138 print "LOG BEGIN $subdir $time $dtime\n"; 122 139 for (my $i = 0; $i <= $#files; $i++) { 123 my $f = $files[$i];140 my $f = $files[$i]; 124 141 my ($ins_id); 125 142 $ins_id = $f; 126 143 $ins_id =~ s/^$subdir\///; 127 144 $ins_id =~ s/\..*//; 128 129 # Write log of what we plan to do.130 my $destination_f = $f;131 $destination_f =~ s%/stsci_shuffle/${source}.${source_vol}/nebulous%/nebulous%;132 133 my $db_uri = $destination_f;134 $db_uri =~ s%^/export/%/data/%;135 $db_uri = 'file://' . $db_uri;136 145 137 print "$ins_id $f $destination_f $db_uri\n"; 146 # Write log of what we plan to do. 147 my $destination_f = $f; 148 $destination_f =~ s%/retire_rsync/data/${source}.${source_vol}/nebulous%/nebulous%; 138 149 139 # die; 150 my $db_uri = $destination_f; 151 $db_uri =~ s%^/export/%/data/%; 152 $db_uri = 'file://' . $db_uri; 140 153 141 # Do move of file. 142 if (-e $destination_f) { 143 print "FILE ALREADY FOUND\n"; 144 next; 145 } 154 print "$ins_id $f $destination_f $db_uri\n"; 146 155 147 my $validate_ins_id_query = "SELECT * FROM instance WHERE vol_id = ${source_vol_id} AND ins_id = ${ins_id}"; 148 my @instances = $dbh->selectall_arrayref( $validate_ins_id_query ); 149 if ($#instances != 0) { # We expect one instance on the source 150 print "NO DB ENTRY\n"; 151 next; 152 } 153 # print "PASSED DB CHECK: $#instances\n"; 154 # system("stat ${f}"); 155 system("mv ${f} ${destination_f}"); 156 # system("stat ${destination_f}"); 156 # die; 157 157 158 # Register database change: 158 # Do move of file. 159 if (-e $destination_f) { 160 print "FILE ALREADY FOUND\n"; 161 next; 162 } 159 163 160 unless (-e $destination_f) { 161 die; 162 } 163 164 $query = $dbh->prepare( $sql->update_instance_uri ); 165 $query->execute( $local_vol_id, $db_uri, $ins_id ); 166 $query->finish; 167 # die; 164 my $validate_ins_id_query = "SELECT * FROM instance WHERE vol_id = ${source_vol_id} AND ins_id = ${ins_id}"; 165 my @instances = $dbh->selectall_arrayref( $validate_ins_id_query ); 166 if ($#instances != 0) { # We expect one instance on the source 167 print "NO DB ENTRY\n"; 168 next; 169 } 170 171 172 # print "PASSED DB CHECK: $#instances\n"; 173 # system("stat ${f}"); 174 system("mv ${f} ${destination_f}"); 175 # system("stat ${destination_f}"); 176 177 # Register database change: 178 179 unless (-e $destination_f) { 180 die; 181 } 182 183 $query = $dbh->prepare( $sql->update_instance_uri ); 184 $query->execute( $local_vol_id, $db_uri, $ins_id ); 185 $query->finish; 186 # die; 168 187 } # END loop over files 169 188 rmdir($subdir);
Note:
See TracChangeset
for help on using the changeset viewer.
