/[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 278 by dpavlin, Tue Dec 13 23:47:13 2005 UTC revision 287 by dpavlin, Sun Jan 15 14:00:14 2006 UTC
# Line 295  foreach my $arc (@archives_to_burn) { Line 295  foreach my $arc (@archives_to_burn) {
295    
296          $sth_archive_backup_parts->execute($dvd_nr);          $sth_archive_backup_parts->execute($dvd_nr);
297    
298            if ($sth_archive_backup_parts->rows == 0) {
299                    warn "ERROR: no backup parts found for $dvd_nr. You should re-create that DVD.\n";
300                    print "Do you want to delete invalid DVD #$dvd_nr now? [NO/yes]: ";
301                    my $ok = <STDIN>;
302                    chomp($ok);
303                    if (lc($ok) eq 'yes') {
304                            print "Deleting DVD #$dvd_nr from database...\n";
305    
306                            $dbh->begin_work;
307    
308                            my $sth_delete_dvd = $dbh->prepare( qq{
309                                    delete from archive where dvd_nr = ?
310                            } );
311                            $sth_delete_dvd->execute( $dvd_nr );
312                            $dbh->do( qq{
313                                    select setval('dvd_nr', (select max(dvd_nr) from archive), true)
314                            } );
315    
316                            $dbh->commit;
317                    }
318            }
319    
320          my @volumes;          my @volumes;
321          my $v;  # emtpy volume          my $v;  # emtpy volume
322          my $v_size = 0;          my $v_size = 0;
# Line 317  foreach my $arc (@archives_to_burn) { Line 339  foreach my $arc (@archives_to_burn) {
339          }          }
340          push @volumes, $v if ($v);          push @volumes, $v if ($v);
341    
342            #warn "# volumes: ",Dumper(\@volumes),"\n";
343    
344          my $volumes = $#volumes + 1;          my $volumes = $#volumes + 1;
345          my $volume_nr = 1;          my $volume_nr = 1;
346    

Legend:
Removed from v.278  
changed lines
  Added in v.287

  ViewVC Help
Powered by ViewVC 1.1.26