backups.date AS date,
shares.name AS share,
backups.size AS backup_size,
- backups.inc_size AS compress_size
+ backups.inc_size AS compress_size,
+ backups.parts AS parts
FROM backups, archive_backup, hosts, shares
WHERE archive_backup.backup_id = backups.id
AND hosts.id=backups.hostid
$row->{'copies'} =~ s/^\s*0+\s*$/no/;
$row->{'total_size'} /= (1024*1024);
- my $copies = 'copies';
- $copies = 'copy' if ($row->{'copies'} == 1);
+ my $copies = $row->{'copies'};
+ if ($row->{'parts'} > 1) {
+ $copies .= '/' . $row->{'parts'};
+ }
+
+ my $copies_dest = 'copies';
+ $copies_dest = 'copy' if ($row->{'copies'} == 1);
return
sprintf("%d by %s on %s, %s %s [%.2f Mb]",
$row->{'dvd_nr'},
$row->{'username'},
$row->{'date'},
- $row->{'copies'}, $copies,
+ $copies, $copies_dest,
$row->{'total_size'},
);
}
use POSIX qw/strftime/;
use BackupPC::SearchLib;
use Cwd qw/abs_path/;
+use File::Which;
my $path = abs_path($0);
$path =~ s#/[^/]+$#/#;
die "can't find $tarIncCreate: $!\n" unless (-x $tarIncCreate);
+my $bin;
+foreach my $c (qw/gzip split/) {
+ $bin->{$c} = which($c) || die "$0 needs $c, install it\n";
+}
+
+
my $debug = 0;
$|=1;
# re-create archive?
if ($row->{'inc_size'} == -1 || $size == -1 || $row->{'inc_size'} != $size) {
- my $cmd = qq{rm -Rf $tar_dir/$tar_file && $tarIncCreate -h "$row->{'host'}" -s "$row->{'share'}" -n $row->{'num'} | gzip -9 > $tar_dir/$tar_file};
+ my $cmd = qq{rm -Rf $tar_dir/$tar_file && $tarIncCreate -h "$row->{'host'}" -s "$row->{'share'}" -n $row->{'num'} | $bin->{'gzip'} -9 > $tar_dir/$tar_file};
print STDERR "## $cmd\n" if ($debug);
system($cmd) == 0 or die "failed: $?";
mkdir $in || die "can't mkdir $in: $!";
my $suffix_len = length("$parts");
- system("split -d -b $max_size -a $suffix_len $out $in/part") == 0 or die "can't split $out: $?";
+ system("$bin->{'split'} -d -b $max_size -a $suffix_len $out $in/part") == 0 or die "can't split $out: $?";
unlink $out || die "can't unlink $out: $!";
}