# Version __VERSION__, __RELEASEDATE__
#------------------------------------------------------------------------
+#------------------------------------------------------------------------
+# Version 3.1.0, 25 Nov 2007
+#------------------------------------------------------------------------
+
+* Fixed config editor bug for case where override is unchecked on
+ an array where the current array is shorter than the main config's
+ array.
+
+* Fixed missing close quote in BackupPC_archiveHost reported by Franky
+ Van Liedekerke.
+
+* Replaced "$BinDir/.." with $bpc->InstallDir() for path to BackupPC
+ docs, mentioned by Kenneth Porter.
+
+* Moved default of $Conf{IncrLevels} from lib/BackupPC/Storage/Text.pm
+ to lib/BackupPC/Lib.pm (after the merge of the config files). This
+ fixes a bug that caused $Conf{IncrLevels} to get over-ridden if it
+ was only defined in the main config file. Reported by John Rouillard.
+
+* Fixed the completion status message in BackupPC_dump so that missing
+ error counts appear as 0, rather than empty. Reported by Bill.
+
+* Changed lib/BackupPC/Xfer/RsyncFileIO.pm to only increment the error
+ count when the md4 checksum fails on the second phase, not the first.
+ Reported by Adrian Bridgett.
+
+* Updated a comment in config.pl about BackupPC_nightly, reported by
+ Dan Pritts.
+
+* Modified lib/BackupPC/CGI/Restore.pm to ensure that the list of hosts
+ presented for direct restore do have direct restore enabled. Reported
+ by Stephen Joyce.
+
+* Modified lib/BackupPC/CGI/RestoreFile.pm to replace \n with \r\n in
+ the restore http response headers. Patch submitted by Thomas Eckhardt.
+
+#------------------------------------------------------------------------
+# Version 3.1.0beta1, 21 Oct 2007
+#------------------------------------------------------------------------
+
* When there is an existing partial, a new partials is only saved
if it has more files than the existing partial. Requested by
Carl Soderstrom.
#
#========================================================================
#
-# Version 3.1.0beta1, released 21 Oct 2007.
+# Version 3.1.0, released 25 Nov 2007.
#
# See http://backuppc.sourceforge.net.
#
#
#========================================================================
#
-# Version 3.1.0beta0, released 3 Sep 2007.
+# Version 3.1.0, released 25 Nov 2007.
#
# See http://backuppc.sourceforge.net.
#
#
#========================================================================
#
-# Version 3.1.0beta0, released 3 Sep 2007.
+# Version 3.1.0, released 25 Nov 2007.
#
# See http://backuppc.sourceforge.net.
#
}
my $cmd = "$tarCreate -t -h $host -n $bkupNum -s $share . ";
$cmd .= "| $compPath " if ( $compPath ne "cat"
- && $compPath ne "/bin/cat
+ && $compPath ne "/bin/cat"
&& $compPath ne "" );
if ( -b $outLoc || -c $outLoc || -f $outLoc ) {
#
#
#========================================================================
#
-# Version 3.1.0beta0, released 3 Sep 2007.
+# Version 3.1.0, released 25 Nov 2007.
#
# See http://backuppc.sourceforge.net.
#
#
#========================================================================
#
-# Version 3.1.0beta0, released 3 Sep 2007.
+# Version 3.1.0, released 25 Nov 2007.
#
# See http://backuppc.sourceforge.net.
#
#
#========================================================================
#
-# Version 3.1.0beta0, released 3 Sep 2007.
+# Version 3.1.0, released 25 Nov 2007.
#
# See http://backuppc.sourceforge.net.
#
#
#========================================================================
#
-# Version 3.1.0beta0, released 3 Sep 2007.
+# Version 3.1.0, released 25 Nov 2007.
#
# See http://backuppc.sourceforge.net.
#
my $otherCount = $stat{xferErrCnt} - $stat{xferBadFileCnt}
- $stat{xferBadShareCnt};
+$stat{fileCnt} ||= 0;
+$stat{byteCnt} ||= 0;
+$stat{xferErrCnt} ||= 0;
+$stat{xferBadFileCnt} ||= 0;
+$stat{xferBadShareCnt} ||= 0;
print(LOG $bpc->timeStamp,
"$type backup $newNum complete, $stat{fileCnt} files,"
. " $stat{byteCnt} bytes,"
#
#========================================================================
#
-# Version 3.1.0beta0, released 3 Sep 2007.
+# Version 3.1.0, released 25 Nov 2007.
#
# See http://backuppc.sourceforge.net.
#
#
#========================================================================
#
-# Version 3.1.0beta0, released 3 Sep 2007.
+# Version 3.1.0, released 25 Nov 2007.
#
# See http://backuppc.sourceforge.net.
#
#
#========================================================================
#
-# Version 3.1.0beta0, released 3 Sep 2007.
+# Version 3.1.0, released 25 Nov 2007.
#
# See http://backuppc.sourceforge.net.
#
#
#========================================================================
#
-# Version 3.1.0beta0, released 3 Sep 2007.
+# Version 3.1.0, released 25 Nov 2007.
#
# See http://backuppc.sourceforge.net.
#
#
#========================================================================
#
-# Version 3.1.0beta0, released 3 Sep 2007.
+# Version 3.1.0, released 25 Nov 2007.
#
# See http://backuppc.sourceforge.net.
#
#
#========================================================================
#
-# Version 3.1.0beta0, released 3 Sep 2007.
+# Version 3.1.0, released 25 Nov 2007.
#
# See http://backuppc.sourceforge.net.
#
#
#========================================================================
#
-# Version 3.1.0beta0, released 3 Sep 2007.
+# Version 3.1.0, released 25 Nov 2007.
#
# See http://backuppc.sourceforge.net.
#
#
#========================================================================
#
-# Version 3.1.0beta0, released 3 Sep 2007.
+# Version 3.1.0, released 25 Nov 2007.
#
# See http://backuppc.sourceforge.net.
#
#
#========================================================================
#
-# Version 3.1.0beta0, released 3 Sep 2007.
+# Version 3.1.0, released 25 Nov 2007.
#
# See http://backuppc.sourceforge.net.
#
#
#========================================================================
#
-# Version 3.1.0beta0, released 3 Sep 2007.
+# Version 3.1.0, released 25 Nov 2007.
#
# See http://backuppc.sourceforge.net.
#
#
#========================================================================
#
-# Version 3.1.0beta0, released 3 Sep 2007.
+# Version 3.1.0, released 25 Nov 2007.
#
# See http://backuppc.sourceforge.net.
#
#
#========================================================================
#
-# Version 3.1.0beta0, released 3 Sep 2007.
+# Version 3.1.0, released 25 Nov 2007.
#
# See http://backuppc.sourceforge.net.
#
#
#========================================================================
#
-# Version 3.1.0beta0, released 3 Sep 2007.
+# Version 3.1.0, released 25 Nov 2007.
#
# See http://backuppc.sourceforge.net.
#
# Each night, at the first wakeup listed in $Conf{WakeupSchedule},
# BackupPC_nightly is run. Its job is to remove unneeded files
# in the pool, ie: files that only have one link. To avoid race
-# conditions, BackupPC_nightly runs only when there are no backups
-# running, and no backups will start while it runs.
+# conditions, BackupPC_nightly and BackupPC_link cannot run at
+# the same time. Starting in v3.0.0, BackupPC_nightly can run
+# concurrently with backups (BackupPC_dump).
#
# So to reduce the elapsed time, you might want to increase this
# setting to run several BackupPC_nightly processes in parallel
#
#========================================================================
#
-# Version 3.1.0beta0, released 3 Sep 2007.
+# Version 3.1.0, released 25 Nov 2007.
#
# See http://backuppc.sourceforge.net.
#
#
#========================================================================
#
-# Version 3.1.0beta0, released 3 Sep 2007.
+# Version 3.1.0, released 25 Nov 2007.
#
# See http://backuppc.sourceforge.net.
#
#
#========================================================================
#
-# Version 3.1.0beta0, released 3 Sep 2007.
+# Version 3.1.0, released 25 Nov 2007.
#
# See http://backuppc.sourceforge.net.
#
#
#========================================================================
#
-# Version 3.1.0beta0, released 3 Sep 2007.
+# Version 3.1.0, released 25 Nov 2007.
#
# See http://backuppc.sourceforge.net.
#
#
#========================================================================
#
-# Version 3.1.0beta0, released 3 Sep 2007.
+# Version 3.1.0, released 25 Nov 2007.
#
# See http://backuppc.sourceforge.net.
#
#
#========================================================================
#
-# Version 3.1.0beta0, released 3 Sep 2007.
+# Version 3.1.0, released 25 Nov 2007.
#
# See http://backuppc.sourceforge.net.
#
#
#========================================================================
#
-# Version 3.1.0beta0, released 3 Sep 2007.
+# Version 3.1.0, released 25 Nov 2007.
#
# See http://backuppc.sourceforge.net.
#
}
if ( (my $var = $In{overrideUncheck}) ne "" ) {
#
- # a compound variable was unchecked; delete extra
- # variables to make the shape the same.
+ # a compound variable was unchecked; delete or
+ # add extra variables to make the shape the same.
#
#print STDERR Dumper(\%In);
foreach my $v ( keys(%In) ) {
- next if ( $v !~ /^v_zZ_(\Q$var\E(_zZ_.*|$))/ );
- delete($In{$v}) if ( !defined($In{"orig_zZ_$1"}) );
+ if ( $v =~ /^v_zZ_(\Q$var\E(_zZ_.*|$))/ ) {
+ delete($In{$v}) if ( !defined($In{"orig_zZ_$1"}) );
+ }
+ if ( $v =~ /^orig_zZ_(\Q$var\E(_zZ_.*|$))/ ) {
+ $In{"v_zZ_$1"} = $In{$v};
+ }
}
delete($In{"vflds.$var"});
}
#
#========================================================================
#
-# Version 3.1.0beta0, released 3 Sep 2007.
+# Version 3.1.0, released 25 Nov 2007.
#
# See http://backuppc.sourceforge.net.
#
#
#========================================================================
#
-# Version 3.1.0beta0, released 3 Sep 2007.
+# Version 3.1.0, released 25 Nov 2007.
#
# See http://backuppc.sourceforge.net.
#
#
#========================================================================
#
-# Version 3.1.0beta0, released 3 Sep 2007.
+# Version 3.1.0, released 25 Nov 2007.
#
# See http://backuppc.sourceforge.net.
#
#
#========================================================================
#
-# Version 3.1.0beta0, released 3 Sep 2007.
+# Version 3.1.0, released 25 Nov 2007.
#
# See http://backuppc.sourceforge.net.
#
#
#========================================================================
#
-# Version 3.1.0beta0, released 3 Sep 2007.
+# Version 3.1.0, released 25 Nov 2007.
#
# See http://backuppc.sourceforge.net.
#
umask($Conf{UmaskMode});
} elsif ( $bpc->ConfigMTime() != $ConfigMTime ) {
$bpc->ConfigRead();
+ $TopDir = $bpc->TopDir();
+ $LogDir = $bpc->LogDir();
+ $BinDir = $bpc->BinDir();
%Conf = $bpc->Conf();
$Lang = $bpc->Lang();
$ConfigMTime = $bpc->ConfigMTime();
#
#========================================================================
#
-# Version 3.1.0beta0, released 3 Sep 2007.
+# Version 3.1.0, released 25 Nov 2007.
#
# See http://backuppc.sourceforge.net.
#
#
#========================================================================
#
-# Version 3.1.0beta0, released 3 Sep 2007.
+# Version 3.1.0, released 25 Nov 2007.
#
# See http://backuppc.sourceforge.net.
#
#
#========================================================================
#
-# Version 3.1.0beta0, released 3 Sep 2007.
+# Version 3.1.0, released 25 Nov 2007.
#
# See http://backuppc.sourceforge.net.
#
#
#========================================================================
#
-# Version 3.1.0beta0, released 3 Sep 2007.
+# Version 3.1.0, released 25 Nov 2007.
#
# See http://backuppc.sourceforge.net.
#
#
# Build list of hosts
#
- my $hostDestSel;
- my @hosts;
+ my($hostDestSel, @hosts, $gotThisHost, $directHost);
+
+ #
+ # Check all the hosts this user has permissions for
+ # and make sure direct restore is enabled.
+ # Note: after this loop we have the config for the
+ # last host in @hosts, not the original $In{host}!!
+ #
+ $directHost = $host;
foreach my $h ( GetUserHosts(1) ) {
- my $sel = " selected" if ( $h eq $In{host} );
- $hostDestSel .= "<option value=\"$h\"$sel>${EscHTML($h)}</option>";
- push(@hosts, $h);
+ #
+ # Pick up the host's config file
+ #
+ $bpc->ConfigRead($h);
+ %Conf = $bpc->Conf();
+ my $cmd = $Conf{XferMethod} eq "smb" ? $Conf{SmbClientRestoreCmd}
+ : $Conf{XferMethod} eq "tar" ? $Conf{TarClientRestoreCmd}
+ : $Conf{XferMethod} eq "archive" ? undef
+ : $Conf{RsyncRestoreArgs};
+ if ( ref($cmd) eq "ARRAY" ? @$cmd : $cmd ne "" ) {
+ #
+ # Direct restore is enabled
+ #
+ push(@hosts, $h);
+ $gotThisHost = 1 if ( $h eq $host );
+ }
}
+ $directHost = $hosts[0] if ( !$gotThisHost && @hosts );
+ foreach my $h ( @hosts ) {
+ my $sel = " selected" if ( $h eq $directHost );
+ $hostDestSel .= "<option value=\"$h\"$sel>${EscHTML($h)}</option>";
+ }
#
# Tell the user what options they have
$share = decode_utf8($share);
$content = eval("qq{$Lang->{Restore_Options_for__host2}}");
- if ( @hosts == 1 ) {
- #
- # Pick up the host's config file
- #
- $bpc->ConfigRead($hosts[0]);
- %Conf = $bpc->Conf();
- }
-
#
# Decide if option 1 (direct restore) is available based
# on whether the restore command is set.
#
- my $cmd = $Conf{XferMethod} eq "smb" ? $Conf{SmbClientRestoreCmd}
- : $Conf{XferMethod} eq "tar" ? $Conf{TarClientRestoreCmd}
- : $Conf{XferMethod} eq "archive" ? undef
- : $Conf{RsyncRestoreArgs};
- if ( defined($cmd) ) {
+ if ( $hostDestSel ne "" ) {
$content .= eval(
"qq{$Lang->{Restore_Options_for__host_Option1}}");
} else {
- my $hostDest = $hosts[0];
+ my $hostDest = $In{host};
$content .= eval(
"qq{$Lang->{Restore_Options_for__host_Option1_disabled}}");
}
#
#========================================================================
#
-# Version 3.1.0beta0, released 3 Sep 2007.
+# Version 3.1.0, released 25 Nov 2007.
#
# See http://backuppc.sourceforge.net.
#
my $fileName = $1 if ( $dir =~ /.*\/(.*)/ );
$fileName =~ s/"/\\"/g;
- print "Content-Type: $contentType\n";
- print "Content-Transfer-Encoding: binary\n";
+ print "Content-Type: $contentType\r\n";
+ print "Content-Transfer-Encoding: binary\r\n";
if ( $ENV{HTTP_USER_AGENT} =~ /\bmsie\b/i
&& $ENV{HTTP_USER_AGENT} !~ /\bopera\b/i ) {
from_to($fileName, "utf8", "cp1252")
if ( $Conf{ClientCharset} ne "" );
}
- print "Content-Disposition: attachment; filename=\"$fileName\"\n\n";
+ print "Content-Disposition: attachment; filename=\"$fileName\"\r\n\r\n";
while ( $f->read(\$data, 1024 * 1024) > 0 ) {
print STDOUT $data;
}
#
#========================================================================
#
-# Version 3.1.0beta0, released 3 Sep 2007.
+# Version 3.1.0, released 25 Nov 2007.
#
# See http://backuppc.sourceforge.net.
#
#
#========================================================================
#
-# Version 3.1.0beta0, released 3 Sep 2007.
+# Version 3.1.0, released 25 Nov 2007.
#
# See http://backuppc.sourceforge.net.
#
#
#========================================================================
#
-# Version 3.1.0beta0, released 3 Sep 2007.
+# Version 3.1.0, released 25 Nov 2007.
#
# See http://backuppc.sourceforge.net.
#
#
#========================================================================
#
-# Version 3.1.0beta0, released 3 Sep 2007.
+# Version 3.1.0, released 25 Nov 2007.
#
# See http://backuppc.sourceforge.net.
#
#
#========================================================================
#
-# Version 3.1.0beta0, released 3 Sep 2007.
+# Version 3.1.0, released 25 Nov 2007.
#
# See http://backuppc.sourceforge.net.
#
#
#========================================================================
#
-# Version 3.1.0beta0, released 3 Sep 2007.
+# Version 3.1.0, released 25 Nov 2007.
#
# See http://backuppc.sourceforge.net.
#
$file = $bpc->ConfDir() . "/hosts";
$linkHosts = 1;
} elsif ( $type eq "docs" ) {
- $file = "$BinDir/../doc/BackupPC.html";
+ $file = $bpc->InstallDir() . "/doc/BackupPC.html";
} elsif ( $host ne "" ) {
if ( !defined($In{num}) ) {
# get the latest LOG file
#
#========================================================================
#
-# Version 3.1.0beta1, released 23 Sep 2007.
+# Version 3.1.0, released 25 Nov 2007.
#
# See http://backuppc.sourceforge.net.
#
#
#========================================================================
#
-# Version 3.1.0beta0, released 3 Sep 2007.
+# Version 3.1.0, released 25 Nov 2007.
#
# See http://backuppc.sourceforge.net.
#
EOF
$Lang{Restore_Options_for__host_Option1} = <<EOF;
-Sie können diese Wiederherstellung starten um die Dateien/Verzeichnisse direkt auf den Computer \$host wiederherzustellen.
+Sie können diese Wiederherstellung starten um die Dateien/Verzeichnisse direkt auf den Computer <b>\$directHost</b> wiederherzustellen.
Alternativ können Sie einen anderen Computer und/oder Freigabe als Ziel angeben.
</p><p>
<b>Warnung:</b> alle aktuell existierenden Dateien/Verzeichnisse, die bereits vorhanden sind,
$Lang{Restore_Options_for__host_Option1} = <<EOF;
You can start a restore that will restore these files directly onto
-\$host.
+<b>\$directHost</b>.
</p><p>
<b>Warning:</b> any existing files that match the ones you have
selected will be overwritten!
$Lang{Restore_Options_for__host_Option1} = <<EOF;
Puede empezar un proceso que restaurará estos archivos directamente en
-\$host.
+<b>\$directHost</b>.
</p><p>
<b>¡Atención!:</b> ¡Cualquier archivo existente con el mismo nombre que los que ha
seleccionado será sobreescrito!
$Lang{Restore_Options_for__host_Option1} = <<EOF;
Vous pouvez démarrer une restauration de ces fichiers
-directement sur \$host.
+directement sur <b>\$directHost</b>.
</p><p>
<b>Attention:</b>
tous les fichiers correspondant à ceux que vous avez sélectionnés vont être écrasés !
$Lang{Restore_Options_for__host_Option1} = <<EOF;
È possibile avviare un processo che ripristini questi file direttamente
-su \$host.
+su <b>\$directHost</b>.
</p><p>
<b>Attenzione:</b> ogni file esistente che corrisponde ai file selezionati
sarà sovrascritto!
$Lang{Restore_Options_for__host_Option1} = <<EOF;
U kan deze bestanden rechtstreeks herstellen naar pc
-\$host.
+<b>\$directHost</b>.
</p><p>
<b>Waarschuwing:</b> bestaande bestanden met dezelfde naam zullen
overschreven worden!
$Lang{Restore_Options_for__host_Option1} = <<EOF;
Możesz zacząć przywracanie bezpośrednio na
-\$host.
+<b>\$directHost</b>.
</p><p>
<b>Uwaga:</b> jakikolwiek plik pasujący do tych ktore masz
zaznaczone będzie nadpisany !
$Lang{Restore_Options_for__host_Option1} = <<EOF;
É possível iniciar um processo que restaurará estes arquivos diretamente em
-\$host.
+<b>\$directHost</b>.
</p><p>
<b>Atenção!:</b> Qualquer arquivo existente com o mesmo nome que o que está
selecionado será sobrescrito!
EOF
$Lang{Restore_Options_for__host_Option1} = <<EOF;
-你可以将这些文件直接恢复到客户机 \$host 上。
+你可以将这些文件直接恢复到客户机 <b>\$directHost</b> 上。
</p><p>
<b>警告:</b> 客户机上现存的文件,如果和被恢复的文件具有相同文件名并且位于相同路径,其内容将会被替换!
</p>
#
#========================================================================
#
-# Version 3.1.0beta0, released 3 Sep 2007.
+# Version 3.1.0, released 25 Nov 2007.
#
# See http://backuppc.sourceforge.net.
#
my $bpc = bless {
%$paths,
- Version => '3.1.0beta0',
+ Version => '3.1.0',
}, $class;
$bpc->{storage} = BackupPC::Storage->new($paths);
return $mesg;
}
$bpc->{Lang} = \%Lang;
+
+ #
+ # Make sure IncrLevels is defined
+ #
+ $bpc->{Conf}{IncrLevels} = [1] if ( !defined($bpc->{Conf}{IncrLevels}) );
+
return;
}
#
#========================================================================
#
-# Version 3.1.0beta0, released 3 Sep 2007.
+# Version 3.1.0, released 25 Nov 2007.
#
# See http://backuppc.sourceforge.net.
#
#
#========================================================================
#
-# Version 3.1.0beta0, released 3 Sep 2007.
+# Version 3.1.0, released 25 Nov 2007.
#
# See http://backuppc.sourceforge.net.
#
#
#========================================================================
#
-# Version 3.1.0beta0, released 3 Sep 2007.
+# Version 3.1.0, released 25 Nov 2007.
#
# See http://backuppc.sourceforge.net.
#
delete($conf->{BlackoutWeekDays});
}
- #
- # Make sure IncrLevels is defined
- #
- $conf->{IncrLevels} = [1] if ( !defined($conf->{IncrLevels}) );
-
return (undef, $conf);
}
#
#========================================================================
#
-# Version 3.1.0beta0, released 3 Sep 2007.
+# Version 3.1.0, released 25 Nov 2007.
#
# See http://backuppc.sourceforge.net.
#
#
#========================================================================
#
-# Version 3.1.0beta0, released 3 Sep 2007.
+# Version 3.1.0, released 25 Nov 2007.
#
# See http://backuppc.sourceforge.net.
#
#
#========================================================================
#
-# Version 3.1.0beta0, released 3 Sep 2007.
+# Version 3.1.0, released 25 Nov 2007.
#
# See http://backuppc.sourceforge.net.
#
#
#========================================================================
#
-# Version 3.1.0beta0, released 3 Sep 2007.
+# Version 3.1.0, released 25 Nov 2007.
#
# See http://backuppc.sourceforge.net.
#
#
#========================================================================
#
-# Version 3.1.0beta0, released 3 Sep 2007.
+# Version 3.1.0, released 25 Nov 2007.
#
# See http://backuppc.sourceforge.net.
#
#
#========================================================================
#
-# Version 3.1.0beta0, released 3 Sep 2007.
+# Version 3.1.0, released 25 Nov 2007.
#
# See http://backuppc.sourceforge.net.
#
if ( $phase > 0 ) {
$fio->log("$name: fatal error: md4 doesn't match on retry;"
. " file removed");
+ $fio->{stats}{errorCnt}++;
} else {
$fio->log("$name: md4 doesn't match: will retry in phase 1;"
. " file removed");
}
- $fio->{stats}{errorCnt}++;
if ( defined($fio->{rxOutFd}) ) {
$fio->{rxOutFd}->close;
unlink($fio->{rxOutFile});
#
#========================================================================
#
-# Version 3.1.0beta0, released 3 Sep 2007.
+# Version 3.1.0, released 25 Nov 2007.
#
# See http://backuppc.sourceforge.net.
#
#
#========================================================================
#
-# Version 3.1.0beta0, released 3 Sep 2007.
+# Version 3.1.0, released 25 Nov 2007.
#
# See http://backuppc.sourceforge.net.
#
#
#========================================================================
#
-# Version 3.1.0beta0, released 3 Sep 2007.
+# Version 3.1.0, released 25 Nov 2007.
#
# See http://backuppc.sourceforge.net.
#
umask(0022);
-my $Version = "3.1.0beta1";
-my $ReleaseDate = "21 Oct 2007";
+my $Version = "3.1.0";
+my $ReleaseDate = "25 Nov 2007";
my $DistDir = "dist/BackupPC-$Version";
my @PerlSrc = qw(