-#!/bin/perl -T
+#!/bin/perl
#============================================================= -*-perl-*-
#
# BackupPC_compressPool: Compress existing pool
# Craig Barratt <cbarratt@users.sourceforge.net>
#
# COPYRIGHT
-# Copyright (C) 2001 Craig Barratt
+# Copyright (C) 2001-2003 Craig Barratt
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
#
#========================================================================
#
-# Version 2.0.0_CVS, released 3 Feb 2003.
+# Version 3.0.0beta1, released 30 Jul 2006.
#
# See http://backuppc.sourceforge.net.
#
#========================================================================
use strict;
+no utf8;
use File::Find;
use File::Path;
die("BackupPC::Lib->new failed\n") if ( !(my $bpc = BackupPC::Lib->new) );
$bpc->ChildInit();
my $TopDir = $bpc->TopDir();
+my $LogDir = $bpc->LogDir();
my $BinDir = $bpc->BinDir();
my %Conf = $bpc->Conf();
my $PoolDir = "$TopDir/pool";
$Errors++;
return;
}
+ binmode(FH);
while ( sysread(FH, $dataIn, $CompMaxWrite) > 0 ) {
$flush = 0;
$FileOrigSz += length($dataIn);
close(FH);
return;
}
+ binmode(OUT);
$copy = 1;
}
if ( $copy && $dataOut ne "" ) {
unlink("$file.__z");
return;
}
+ binmode(FH);
}
if ( $copy ) {
if ( !sysseek(OUT, 0, 0) ) {
$f->close();
return;
}
+ binmode(FH);
#print("comparing $file to $cfile\n");
while ( 1 ) {
$n = 1 + int(rand($CompMaxRead) + rand(100));
$f->close();
return;
}
+ binmode(FH);
while ( 1 ) {
$d0 = <FH>;
$d = $f->readLine();
if ( !defined($host) ) {
for ( my $i = 0 ; ; $i++ ) {
- last if ( !-f "$TopDir/log/LOG.$i" );
- push(@Files, "$TopDir/log/LOG.$i");
+ last if ( !-f "$LogDir/LOG.$i" );
+ push(@Files, "$LogDir/LOG.$i");
}
} else {
@Backups = $bpc->BackupInfoRead($host);