my $selected = 0;
my $parts = 1;
-
foreach my $key(keys(%In)) {
+ print LOG "doing $key...";
if ($key =~ m/^fcb([0-9]+)_([0-9]+)_([0-9]+)$/gi) {
+
my ($host_id, $backup_num, $backup_id) = ($1,$2,$3);
push @selected_backup_ids, $backup_id;
- $total_size += BackupPC::SearchLib::getGzipSize($host_id, $backup_num);
+ my $currSize = BackupPC::SearchLib::getGzipSize($host_id, $backup_num);
+ if ($currSize > 0) {
+ $total_size += currSize;
+ }
$selected++;
my ($this_part) = $dbh->selectrow_array("select parts from backups where id = ?", undef, $backup_id);
$this_part--;
$parts += $this_part;
- }
- }
+ } }
if ($total_size > ($Conf{MaxArchiveSize} * $parts)) {
$cont .= eval( q{ ${h2(Error)}});