/[BackupPC]/trunk/lib/BackupPC/CGI/BurnMedia.pm
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/lib/BackupPC/CGI/BurnMedia.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 165 by dpavlin, Mon Oct 10 13:57:29 2005 UTC revision 197 by dpavlin, Thu Oct 13 18:33:00 2005 UTC
# Line 38  EOF Line 38  EOF
38                  my @selected_backup_ids;                  my @selected_backup_ids;
39    
40                  my $total_size = 0;                  my $total_size = 0;
41                                    my $selected = 0;
42    
43                  foreach my $key(keys(%In)) {                  foreach my $key(keys(%In)) {
44                          if ($key =~ m/^fcb([0-9]+)_([0-9]+)_([0-9]+)$/gi) {                          if ($key =~ m/^fcb([0-9]+)_([0-9]+)_([0-9]+)$/gi) {
45                                  my ($host_id, $backup_num, $backup_id) = ($1,$2,$3);                                  my ($host_id, $backup_num, $backup_id) = ($1,$2,$3);
46                                  push @selected_backup_ids, $backup_id;                                  push @selected_backup_ids, $backup_id;
47                                  $total_size += BackupPC::SearchLib::getGzipSize($host_id, $backup_num);                                  $total_size += BackupPC::SearchLib::getGzipSize($host_id, $backup_num);
48                                    $selected++;
49                          }                          }
50                  }                  }
51    
52                  if (($total_size / 1024) > $Conf{MaxArchiveSize}) {                  my $total_kb = int($total_size / 1024);
53    
54                    # and now a little magic to check multi-volume increments
55                    my $parts = 1;
56                    if ($#selected_backup_ids == 0) {
57                            ($parts) = $dbh->selectrow_array("select parts from backups where id = ?", undef, $selected_backup_ids[0]);
58                    }
59    
60                    if ($total_kb > ($Conf{MaxArchiveSize} * $parts)) {
61                            $cont .= eval( q{ ${h2(Error)}});
62                            $cont .= "Selected backups size $total_kb Kb exceed max archive size $Conf{MaxArchiveSize} Kb.";
63                    } elsif ($total_size == 0) {
64                          $cont .= eval( q{ ${h2(Error)}});                          $cont .= eval( q{ ${h2(Error)}});
65                          $cont .= "Selected backups size $total_size exceed max archive size $Conf{MaxArchiveSize}.";                          $cont .= "No backups selected.";
66                  } else {                  } else {
67    
68                          # create new archive                          # create new archive

Legend:
Removed from v.165  
changed lines
  Added in v.197

  ViewVC Help
Powered by ViewVC 1.1.26