/[BackupPC]/trunk/bin/BackupPC_burnArchiveCLI
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/bin/BackupPC_burnArchiveCLI

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 292 by dpavlin, Thu Jan 26 00:39:47 2006 UTC revision 322 by dpavlin, Mon Jan 30 17:45:25 2006 UTC
# Line 278  sub delete_dvd($) { Line 278  sub delete_dvd($) {
278    
279                  # remove files for this DVD                  # remove files for this DVD
280                  map {                  map {
281                          print "\tremoving $_\n";                          if (-d $_) {
282                          unlink($_) || die "can't rm $_: $!";                                  print "\tremoving dir $_\n";
283                                    rmtree($_) || die "can't rmtree $_: $!";
284                            } else {
285                                    print "\tremoving $_\n";
286                                    unlink($_) || die "can't rm $_: $!";
287                            }
288                  } glob ( "/$iso_dir/$dvd_nr.*" );                  } glob ( "/$iso_dir/$dvd_nr.*" );
289    
290                  $dbh->commit;                  $dbh->commit;
# Line 314  my $sth_archive_backup_parts = $dbh->pre Line 319  my $sth_archive_backup_parts = $dbh->pre
319    
320  my $sth_archive_backup_check = $dbh->prepare( qq{  my $sth_archive_backup_check = $dbh->prepare( qq{
321                  SELECT                  SELECT
322                          count(backups.id)                          sum(backups.parts)
323                  FROM backups                  FROM backups
324                  JOIN archive_backup on archive_backup.backup_id = backups.id                  JOIN archive_backup on archive_backup.backup_id = backups.id
325                  JOIN archive on archive_id = archive.id                  JOIN archive on archive_id = archive.id
# Line 346  foreach my $arc (@archives_to_burn) { Line 351  foreach my $arc (@archives_to_burn) {
351          my ($parts_nr, $check_nr) = ($sth_archive_backup_parts->rows, $sth_archive_backup_check->fetchrow_array);          my ($parts_nr, $check_nr) = ($sth_archive_backup_parts->rows, $sth_archive_backup_check->fetchrow_array);
352    
353          if ($parts_nr != $check_nr) {          if ($parts_nr != $check_nr) {
354                  warn "ERROR: DVD #$dvd_nr is still not in consistent state. Some backup parts are ",                  warn "ERROR: DVD #$dvd_nr is still not inconsistent state. Some backup parts are ",
355                          ($parts_nr < $check_nr) ? "missing ($parts_nr < $check_nr)" : "extra ($parts_nr > $check_nr)",                          ($parts_nr < $check_nr) ? "missing ($parts_nr < $check_nr)" : "extra ($parts_nr > $check_nr)",
356                          " you should re-create this DVD after BackupPC_incPartsUpdate finish\n";                          " you should re-create this DVD after BackupPC_incPartsUpdate finish\n";
357                  next if delete_dvd( $dvd_nr );                  delete_dvd( $dvd_nr );
358                    next;
359          }          }
360    
361          if ($sth_archive_backup_parts->rows == 0) {          if ($sth_archive_backup_parts->rows == 0) {
# Line 521  print "Recoding finished, exiting...\n"; Line 527  print "Recoding finished, exiting...\n";
527  $sth->finish;  $sth->finish;
528  $sth_archive_backup_parts->finish;  $sth_archive_backup_parts->finish;
529  $sth_archive_burned->finish;  $sth_archive_burned->finish;
530    $sth_archive_backup_check->finish;
531    $sth_archive_burned->finish;
532    
533  $dbh->disconnect;  $dbh->disconnect;
534    

Legend:
Removed from v.292  
changed lines
  Added in v.322

  ViewVC Help
Powered by ViewVC 1.1.26