/[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 276 by dpavlin, Tue Dec 13 22:55:59 2005 UTC revision 286 by dpavlin, Sun Jan 15 13:41:23 2006 UTC
# Line 1  Line 1 
1  #!/usr/bin/perl  #!/usr/bin/perl
2    
3  use strict;  use strict;
4  #use lib "__INSTALLDIR__/lib";  use lib "__INSTALLDIR__/lib";
 use lib "/data/backuppc-agi/lib";  
5    
6  use DBI;  use DBI;
7  use BackupPC::Lib;  use BackupPC::Lib;
# Line 296  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            }
301    
302          my @volumes;          my @volumes;
303          my $v;  # emtpy volume          my $v;  # emtpy volume
304          my $v_size = 0;          my $v_size = 0;
# Line 318  foreach my $arc (@archives_to_burn) { Line 321  foreach my $arc (@archives_to_burn) {
321          }          }
322          push @volumes, $v if ($v);          push @volumes, $v if ($v);
323    
324            #warn "# volumes: ",Dumper(\@volumes),"\n";
325    
326          my $volumes = $#volumes + 1;          my $volumes = $#volumes + 1;
327          my $volume_nr = 1;          my $volume_nr = 1;
328    
329          foreach my $v (@volumes) {          foreach my $v (@volumes) {
330    
331                  print Dumper($v);                  #print Dumper($v);
332    
333                  my $iso_size = 0;                  my $iso_size = 0;
334                  my $disk_name = $dvd_nr;                  my $disk_name = $dvd_nr;
# Line 369  foreach my $arc (@archives_to_burn) { Line 374  foreach my $arc (@archives_to_burn) {
374                                  my $rel_path = $tar_file;                                  my $rel_path = $tar_file;
375    
376                                  if (-d "$tar_dir/$rel_path") {                                  if (-d "$tar_dir/$rel_path") {
                                         $rel_path .= '/' . $p->{part_nr};  
377                                          mkpath("$stage/$rel_path") unless (-d "$stage/$rel_path");                                          mkpath("$stage/$rel_path") unless (-d "$stage/$rel_path");
378                                            $rel_path .= '/' . $p->{part_nr};
379                                  }                                  }
380                                  $rel_path .= '.tar.gz';                                  $rel_path .= '.tar.gz';
381    
# Line 410  foreach my $arc (@archives_to_burn) { Line 415  foreach my $arc (@archives_to_burn) {
415    
416                          print "Created $iso_file [$iso_size bytes] in ", fmt_time(time() - $t), "\n";                          print "Created $iso_file [$iso_size bytes] in ", fmt_time(time() - $t), "\n";
417    
418                          # FIXME                          rmtree($stage) || warn "can't remove stage directory $stage: $!";
                         #rmtree($stage) || warn "can't remove stage directory $stage: $!";  
419    
420                  } else {                  } else {
421                          print "ISO $iso_file allready exists\n";                          print "ISO $iso_file allready exists\n";

Legend:
Removed from v.276  
changed lines
  Added in v.286

  ViewVC Help
Powered by ViewVC 1.1.26