* Added fix to lib/BackupPC/Lang/nl.pm from Lieven Bridts.
* Added patch from Tony Nelson to remove $Info{pid} before BackupPC
writes the status and shuts down.
* Changed BackupPC_nightly so that it doesn't call find() if the
directory doesn't exist. This avoids errors in certain versions
of perl. Reported by Bernd Rilling.
* Fixed BackupPC::CGI::Lib to correctly re-load config.pl for mod_perl.
Reported by Tony Nelson and Jimmy Liang.
* Explicitly untaint $In{host} in BackupPC::CGI::Lib to fix problem
reported by Thomas Tempé.
* Added newline to "...skipping because of user requested delay..."
log message in BackupPC_dump. Reported by Wayne Scott.
* Added read file size error checking to BackupPC_tarCreate.
Reported by Brandon Evans.
* Added check in BackupPC::Xfer::RsyncFileIO to ensure that when
compression is toggled on/off, a compressed backup doesn't link
to an uncompressed pool file (and an uncompressed backup doesn't
link to a compressed pool file). Reported by Brandon Evans.
* Updated documentation with new dirvish URL and a typo from
Todd Curry.
* Fix to BackupPC_sendEmail so that it correctly sends admin emails
for hosts that have failed backups. Reported by Simon Kuhn.
#------------------------------------------------------------------------
# Version __VERSION__, __RELEASEDATE__
#------------------------------------------------------------------------
+
+* Added fix to lib/BackupPC/Lang/nl.pm from Lieven Bridts.
+
+* Added patch from Tony Nelson to remove $Info{pid} before BackupPC
+ writes the status and shuts down.
+
+* Changed BackupPC_nightly so that it doesn't call find() if the
+ directory doesn't exist. This avoids errors in certain versions
+ of perl. Reported by Bernd Rilling.
+
+* Fixed BackupPC::CGI::Lib to correctly re-load config.pl for mod_perl.
+ Reported by Tony Nelson and Jimmy Liang.
+
+* Explicitly untaint $In{host} in BackupPC::CGI::Lib to fix problem
+ reported by Thomas Tempé.
+
+* Added newline to "...skipping because of user requested delay..."
+ log message in BackupPC_dump. Reported by Wayne Scott.
+
+* Added read file size error checking to BackupPC_tarCreate.
+ Reported by Brandon Evans.
+
+* Added check in BackupPC::Xfer::RsyncFileIO to ensure that when
+ compression is toggled on/off, a compressed backup doesn't link
+ to an uncompressed pool file (and an uncompressed backup doesn't
+ link to a compressed pool file). Reported by Brandon Evans.
+
+* Updated documentation with new dirvish URL and a typo from
+ Todd Curry.
+
+* Fix to BackupPC_sendEmail so that it correctly sends admin emails
+ for hosts that have failed backups. Reported by Simon Kuhn.
+
+#------------------------------------------------------------------------
+# Version 2.1.0, 20 Jun 2004
+#------------------------------------------------------------------------
* Added Dutch translation from Lieven Bridts, with tweaks from
Guus Houtzager.
}
%Jobs = ();
}
+ delete($Info{pid});
StatusWrite();
unlink("$TopDir/log/BackupPC.pid");
exit(1);
}
if ( !$opts{i} && !$opts{f} && $StatusHost{backoffTime} > time ) {
- printf(LOG "%sskipping because of user requested delay (%.1f hours left)",
+ printf(LOG "%sskipping because of user requested delay (%.1f hours left)\n",
$bpc->timeStamp, ($StatusHost{backoffTime} - time) / 3600);
NothingToDo($needLink);
}
$fileLinkMax = 0;
$fileCntRename = 0;
%FixList = ();
- find({wanted => \&GetPoolStats}, "$TopDir/$pool/$dir");
+ find({wanted => \&GetPoolStats}, "$TopDir/$pool/$dir")
+ if ( -d "$TopDir/$pool/$dir" );
my $kb = $blkCnt / 2;
my $kbRm = $blkCntRm / 2;
my $kb2 = $blkCnt2 / 2;
my @badHosts = ();
foreach my $host ( sort(keys(%Status)) ) {
- next if ( $Status{$host}{reason} ne "backup failed"
+ next if ( ($Status{$host}{reason} ne "Reason_backup_failed"
+ && $Status{$host}{reason} ne "Reason_restore_failed")
|| $Status{$host}{error} =~ /^lost network connection to host/ );
push(@badHosts, "$host ($Status{$host}{error})");
}
TarWriteFileInfo($fh, $hdr);
my($data, $size);
while ( $f->read(\$data, $BufSize) > 0 ) {
+ if ( $size + length($data) > $hdr->{size} ) {
+ print(STDERR "Error: truncating $hdr->{fullPath} to"
+ . " $hdr->{size} bytes\n");
+ $data = substr($data, 0, $hdr->{size} - $size);
+ $ErrorCnt++;
+ }
TarWrite($fh, \$data);
$size += length($data);
}
$f->close;
+ if ( $size != $hdr->{size} ) {
+ print(STDERR "Error: padding $hdr->{fullPath} to $hdr->{size}"
+ . " bytes from $size bytes\n");
+ $ErrorCnt++;
+ while ( $size < $hdr->{size} ) {
+ my $len = $hdr->{size} - $size;
+ $len = $BufSize if ( $len > $BufSize );
+ $data = "\0" x $len;
+ TarWrite($fh, \$data);
+ $size += $len;
+ }
+ }
TarWritePad($fh, $size);
$FileCnt++;
$ByteCnt += $size;
Various programs and scripts use rsync to provide hardlinked backups.
See, for example, Mike Rubel's site (L<http://www.mikerubel.org/computers/rsync_snapshots>),
-JW Schultz's dirvish (L<http://www.pegasys.ws/dirvish> (although as of
-June 2004 this link doesn't work)),
+JW Schultz's dirvish (L<http://www.dirvish.org>),
Ben Escoto's rdiff-backup (L<http://rdiff-backup.stanford.edu>),
and John Bowman's rlbackup (L<http://www.math.ualberta.ca/imaging/rlbackup>).
Note that for direct restore to work, the $Conf{XferMethod} must
be able to write to the client. For example, that means an SMB
share for smbclient needs to be writable, and the rsyncd module
-needs "read only" set to "yes". This creates additional security
+needs "read only" set to "false". This creates additional security
risks. If you only create read-only SMB shares (which is a good
idea), then the direct restore will fail. You can disable the
direct restore option by setting $Conf{SmbClientRestoreCmd},
$Lang = $bpc->Lang();
$ConfigMTime = $bpc->ConfigMTime();
} elsif ( $bpc->ConfigMTime() != $ConfigMTime ) {
- $bpc->ServerMesg("log Re-read config file because mtime changed");
- $bpc->ServerMesg("server reload");
+ $bpc->ConfigRead();
+ %Conf = $bpc->Conf();
+ $Lang = $bpc->Lang();
+ $ConfigMTime = $bpc->ConfigMTime();
}
#
{map {$_, 1} split(",", $Hosts->{$host}{moreUsers}) }
}
}
+
+ #
+ # Untaint the host name
+ #
+ if ( $In{host} =~ /^([\w.\s-]+)$/ ) {
+ $In{host} = $1;
+ } else {
+ delete($In{host});
+ }
}
sub timeStamp2
#my %lang;
#use strict;
-#File: nl.pm version 1.3
+#File: nl.pm version 1.5
# --------------------------------
$Lang{Start_Archive} = "Start Archivering";
en het maximum van gisteren was \$Info{DUDailyMaxPrev}%.
</ul>
</ul>
-eof
+EOF
$Lang{BackupPC_Server_Status} = <<EOF;
\${h1(qq{$Lang{H_BackupPC_Server_Status}})}
$Lang{Restore_Options_for__host_Option1_disabled} = <<EOF;
Rechtstreeks terugplaatsen is gedeactiveerd voor machine \${EscHTML(\$hostDest)}.
Gelieve een van de andere herstelopties te kiezen.
-eof
+EOF
# ------------------------------
$Lang{Option_2__Download_Zip_archive} = <<EOF;
. " ($fio->{rxFile}{size} vs $rxSize)")
if ( $fio->{logLevel} >= 5 );
}
+ #
+ # If compression was off and now on, or on and now off, then
+ # don't do an exact match.
+ #
+ if ( defined($fio->{rxLocalAttr})
+ && !$fio->{rxLocalAttr}{compress} != !$fio->{xfer}{compress} ) {
+ $fio->{rxMatchBlk} = undef; # compression changed, so no file match
+ $fio->log("$fio->{rxFile}{name}: compression changed, so no match"
+ . " ($fio->{rxLocalAttr}{compress} vs $fio->{xfer}{compress})")
+ if ( $fio->{logLevel} >= 4 );
+ }
delete($fio->{rxInFd});
delete($fio->{rxOutFd});
delete($fio->{rxDigest});
umask(0022);
-my $Version = "2.1.0";
-my $ReleaseDate = "20 Jun 2004";
+my $Version = "2.1.0pl1";
+my $ReleaseDate = "15 Aug 2004";
my $DistDir = "dist/BackupPC-$Version";
my @PerlSrc = qw(