fix inc_size
[BackupPC.git] / bin / BackupPC_ASA_PostArchive_Update
index 3d531ee..8b31d6f 100755 (executable)
@@ -242,8 +242,8 @@ sub check_archive {
 
                my $size = (stat( $path ))[7] || die "can't stat $path: $!";
 
-               if ($size > $Conf{MaxArchiveSize}) {
-                       print ", part bigger than media $size > $Conf{MaxArchiveSize}\n";
+               if ($size > $Conf{ArchiveMediaSize}) {
+                       print ", part bigger than media $size > $Conf{ArchiveMediaSize}\n";
                        return 0;
                }
 
@@ -263,8 +263,8 @@ sub check_archive {
                        $items++;
                        $tar_size_inarc += $entry->size;
 
-                       if ($tar_size_inarc > $Conf{MaxArchiveFileSize}) {
-                               print ", part $filename is too big $tar_size_inarc > $Conf{MaxArchiveFileSize}\n";
+                       if ($tar_size_inarc > $Conf{ArchiveChunkSize}) {
+                               print ", part $filename is too big $tar_size_inarc > $Conf{ArchiveChunkSize}\n";
                                return 0;
                        }
 
@@ -301,7 +301,7 @@ sub check_archive {
                check_part($host, $num, $part_nr, $tar_size, $size, $md5, $items);
 
                # round increment size to 2k block size
-               $inc_size += int(($size + 2048) / 2048);
+               $inc_size += int((($size + 2048) / 2048 ) * 2048);
        }
 
        $sth_inc_size->execute(