Changeset 29561 for trunk/ippScripts/scripts/magic_destreak_cleanup.pl
- Timestamp:
- Oct 26, 2010, 8:39:32 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/magic_destreak_cleanup.pl
r29097 r29561 89 89 $q1 .= " WHERE magic_ds_id = $magic_ds_id"; 90 90 91 my $q2 = "SELECT * from magicDSFile wheremagic_ds_id = $magic_ds_id";91 my $q2 = "SELECT * from magicDSFile WHERE (data_state = 'full' OR data_state = 'update') AND magic_ds_id = $magic_ds_id"; 92 92 93 93 my $stmt1 = $dbh->prepare($q1); … … 245 245 delete_files($rimage, $rmask, $rweight, $rsources, undef, $bimage, $bmask, $bweight, $bsources); 246 246 } 247 } 248 249 $dbh = DBI->connect($dsn, $dbuser, $dbpassword) or die "Cannot connect to mysql server\n"; 250 251 if (!$no_update and ($num_components > 0)) { 252 my $result = $dbh->do("DELETE FROM magicDSFile WHERE magic_ds_id = ?", undef, $magic_ds_id); 253 # my $result = $stmt3->do($magic_ds_id); 254 my_die("attempt to delete magicDSFiles failed", $magic_ds_id, $PS_EXIT_UNKNOWN_ERROR) if $result eq "0E0"; 255 } 256 257 if (!$no_update) { 258 my $result = $dbh->do("UPDATE magicDSRun SET state = 'cleaned' WHERE magic_ds_id = ?", undef, $magic_ds_id); 259 my_die("attempt to update magicDSRun.state failed", $magic_ds_id, $PS_EXIT_UNKNOWN_ERROR) if $result eq "0E0"; 260 } else { 261 print STDERR "skipping update of magicDSRun\n"; 262 } 263 247 my $command = "$magicdstool -tocleanedfile -magic_ds_id $magic_ds_id -component $component"; 248 $command .= " -dbname $dbname" if defined $dbname; 249 250 unless ($no_update) { 251 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 252 run(command => $command, verbose => $verbose); 253 unless ($success) { 254 carp("failed to update database for $magic_ds_id"); 255 } 256 } else { 257 print "Skipping command: $command\n"; 258 } 259 } 264 260 265 261 ### Pau. … … 292 288 $exit_code = $PS_EXIT_PROG_ERROR unless defined $exit_code; 293 289 294 my $command = "$magicdstool -updaterun -set_state failed_cleanup";290 my $command = "$magicdstool -updaterun -set_state error_cleaned"; 295 291 $command .= " -magic_ds_id $magic_ds_id"; 296 292 $command .= " -dbname $dbname" if defined $dbname;
Note:
See TracChangeset
for help on using the changeset viewer.
