Changeset 38684 for trunk/tools
- Timestamp:
- Aug 26, 2015, 3:57:07 PM (11 years ago)
- File:
-
- 1 edited
-
trunk/tools/stsci_disks/p4_restore.pl (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/stsci_disks/p4_restore.pl
r38683 r38684 83 83 84 84 85 #my $logDest = "neb://any/stsci_shuffle/restore/${host}.${volume}/${source}.${volume}/${dir}.log.${time}";86 #my $ipprc = PS::IPP::Config->new( "GPC1" ) or die "Could not create config object.\n";87 #$ipprc->redirect_output($logDest) or die "Could not redirect output to logfile ${logDest}\n";85 my $logDest = "neb://any/stsci_shuffle/restore/${host}.${volume}/${source}.${volume}/${dir}.log.${time}"; 86 my $ipprc = PS::IPP::Config->new( "GPC1" ) or die "Could not create config object.\n"; 87 $ipprc->redirect_output($logDest) or die "Could not redirect output to logfile ${logDest}\n"; 88 88 89 89 my $root = "/export/${host}.${volume}/stsci_shuffle/${source}.${source_vol}/nebulous/${dir}"; … … 142 142 if (-e $destination_f) { 143 143 print "FILE ALREADY FOUND\n"; 144 next; 144 145 } 145 system("stat ${f}"); 146 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}"); 146 155 system("mv ${f} ${destination_f}"); 147 system("stat ${destination_f}");156 # system("stat ${destination_f}"); 148 157 149 158 # Register database change: … … 153 162 } 154 163 155 156 164 $query = $dbh->prepare( $sql->update_instance_uri ); 157 165 $query->execute( $local_vol_id, $db_uri, $ins_id ); 158 166 $query->finish; 159 die; 160 } 161 } 167 # die; 168 } # END loop over files 169 rmdir($subdir); 170 } # END loop over subdirectories 171 rmdir($root); 162 172
Note:
See TracChangeset
for help on using the changeset viewer.
