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; |
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; |
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; |
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 |
|
|
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"; |