written by the editor have more restrictive permissions.
Reported by Tim Massey.
* Host summary now shows active backups on disabled hosts,
from Jono Woodhouse.
* Fixed host LOG link and LOG list order, reported by Tim Massey.
* Moved Encode.pm version check to start of configure.pl so it
produces a useful error message if Encode.pm is too old.
* Fixed hrefs to configuration documentation to handle changes
in the way perl generates the anchors. Reported by Philip
Gleghorn.
* Host name links in LOG files now allow "." in the host name.
Reported by Jean-Michel Beuken.
* Fixes to lib/BackupPC/Xfer/Tar.pm for tar 1.16: allow 1
(ie: 256) as a successful exit status and match "Total
bytes read" message for restores. First reported by
Torsten Sadowski and debugged by Ralf Gross and Holger
Parplies.
# Version __VERSION__, __RELEASEDATE__
#------------------------------------------------------------------------
+* BackupPC_Admin now uses $Conf{UmaskMode}, so config.pl files
+ written by the editor have more restrictive permissions.
+ Reported by Tim Massey.
+
+* Host summary now shows active backups on disabled hosts,
+ from Jono Woodhouse.
+
+* Fixed host LOG link and LOG list order, reported by Tim Massey.
+
+* Moved Encode.pm version check to start of configure.pl so it
+ produces a useful error message if Encode.pm is too old.
+
+* Fixed hrefs to configuration documentation to handle changes
+ in the way perl generates the anchors. Reported by Philip
+ Gleghorn.
+
+* Host name links in LOG files now allow "." in the host name.
+ Reported by Jean-Michel Beuken.
+
+* Fixes to lib/BackupPC/Xfer/Tar.pm for tar 1.16: allow 1
+ (ie: 256) as a successful exit status and match "Total
+ bytes read" message for restores. First reported by
+ Torsten Sadowski and debugged by Ralf Gross and Holger
+ Parplies.
+
+#------------------------------------------------------------------------
+# Version 3.0.0beta3, 3 Dec 2006
+#------------------------------------------------------------------------
+
* Removed default paths from conf/config.pl so configure.pl will
determine the correct ones at install time. Avoids problem of
the config editor complaining about bad executable paths the
# the setting is assumed to apply all shares.
#
# If a hash is used, a special key "*" means it applies to all
-# shares.
+# shares that don't have a specific entry.
#
# Examples:
# $Conf{BackupFilesOnly} = '/myFiles';
# followed by "/*", eg: "/proc/*", instead of just "/proc".
#
# If a hash is used, a special key "*" means it applies to all
-# shares.
+# shares that don't have a specific entry.
#
# Examples:
# $Conf{BackupFilesExclude} = '/temp';
TarIncrArgs => 1,
TarClientCmd => 0,
TarClientRestoreCmd => 0,
+ TarClientPath => 0,
RsyncShareName => 1,
RsyncdClientPort => 1,
RsyncdPasswd => 1,
RsyncRestoreArgs => 1,
RsyncClientCmd => 0,
RsyncClientRestoreCmd => 0,
+ RsyncClientPath => 0,
ArchiveDest => 1,
ArchiveComp => 1,
ArchivePar => 1,
no utf8;
use vars qw(%Conf %OrigConf);
use lib "./lib";
+use Encode;
+
+my $EncodeVersion = eval($Encode::VERSION);
+if ( $EncodeVersion < 1.99 ) {
+ print("Error: you need to upgrade perl's Encode package.\n"
+ . "I found $EncodeVersion and BackupPC needs >= 1.99\n"
+ . "Please go to www.cpan.org or use the cpan command.\n");
+ exit(1);
+}
my @Packages = qw(File::Path File::Spec File::Copy DirHandle Digest::MD5
- Data::Dumper Getopt::Std Getopt::Long Encode Pod::Usage
+ Data::Dumper Getopt::Std Getopt::Long Pod::Usage
BackupPC::Lib BackupPC::FileZIO);
foreach my $pkg ( @Packages ) {
EOF
}
-my $EncodeVersion = eval($Encode::VERSION);
-if ( $EncodeVersion < 1.99 ) {
- print("\nError: you need to upgrade the Encode package;"
- . " I found $EncodeVersion and BackupPC needs >= 1.99\n\n");
- exit(1);
-}
-
my %opts;
$opts{"set-perms"} = 1;
if ( !GetOptions(
Use locations specified by the Filesystem Hierarchy Standard
for installing BackupPC. This is enabled by default for new
-installatios. To use the pre-3.0 installation locations,
+installations. To use the pre-3.0 installation locations,
specify --no-fhs.
=item B<--help|?>
For BackupPC to use Rsync you will also need to install the perl
File::RsyncP module, which is available from
L<http://perlrsync.sourceforge.net>.
-Version 0.70 or later is required.
+Version 0.68 or later is required.
=item *
#
#========================================================================
#
-# Version 3.0.0beta2, released 11 Nov 2006.
+# Version 3.0.0beta3, released 3 Dec 2006.
#
# See http://backuppc.sourceforge.net.
#
#
# default to the newest backup
#
- if ( !defined($In{num}) && defined(@Backups) ) {
+ if ( !defined($In{num}) && defined(@Backups) && @Backups > 0 ) {
$i = @Backups - 1;
$num = $Backups[$i]{num};
}
#
#========================================================================
#
-# Version 3.0.0beta2, released 18 Nov 2006.
+# Version 3.0.0beta3, released 3 Dec 2006.
#
# See http://backuppc.sourceforge.net.
#
if ( $level == 0 ) {
my $lcVarName = lc($varName);
$content .= <<EOF;
-<tr><td class="border"><a href="?action=view&type=docs#item_%24conf%7b$lcVarName%7d">$varName</a>
+<tr><td class="border"><a href="?action=view&type=docs#item__conf_${lcVarName}_">$varName</a>
EOF
if ( defined($overrideVar) ) {
my $override_checked = "";
#
#========================================================================
#
-# Version 3.0.0beta2, released 11 Nov 2006.
+# Version 3.0.0beta3, released 3 Dec 2006.
#
# See http://backuppc.sourceforge.net.
#
%Conf = $bpc->Conf();
$Lang = $bpc->Lang();
$ConfigMTime = $bpc->ConfigMTime();
+ umask($Conf{UmaskMode});
} elsif ( $bpc->ConfigMTime() != $ConfigMTime ) {
$bpc->ConfigRead();
%Conf = $bpc->Conf();
$Lang = $bpc->Lang();
$ConfigMTime = $bpc->ConfigMTime();
+ umask($Conf{UmaskMode});
}
#
#
#========================================================================
#
-# Version 3.0.0beta2, released 11 Nov 2006.
+# Version 3.0.0beta3, released 3 Dec 2006.
#
# See http://backuppc.sourceforge.net.
#
$reasonHilite = $Conf{CgiStatusHilightColor}{$Status{$host}{reason}}
|| $Conf{CgiStatusHilightColor}{$Status{$host}{state}};
if ( $Conf{BackupsDisable} == 1 ) {
- $reasonHilite = $Conf{CgiStatusHilightColor}{Disabled_OnlyManualBackups};
- $tempState = "Disabled_OnlyManualBackups";
- $tempReason = "";
+ if ( $Status{$host}{state} ne "Status_backup_in_progress"
+ && $Status{$host}{state} ne "Status_restore_in_progress" ) {
+ $reasonHilite = $Conf{CgiStatusHilightColor}{Disabled_OnlyManualBackups};
+ $tempState = "Disabled_OnlyManualBackups";
+ $tempReason = "";
+ } else {
+ $tempState = $Status{$host}{state};
+ $tempReason = $Status{$host}{reason};
+ }
} elsif ($Conf{BackupsDisable} == 2 ) {
$reasonHilite = $Conf{CgiStatusHilightColor}{Disabled_AllBackupsDisabled};
$tempState = "Disabled_AllBackupsDisabled";
#
#========================================================================
#
-# Version 3.0.0beta2, released 11 Nov 2006.
+# Version 3.0.0beta3, released 3 Dec 2006.
#
# See http://backuppc.sourceforge.net.
#
if ( !defined($In{num}) ) {
# get the latest LOG file
$file = ($bpc->sortedPCLogFiles($host))[0];
+ $file =~ s/\.z$//;
} else {
$file = "$TopDir/pc/$host/LOG$ext";
}
last if ( $s eq "" );
$s =~ s/[\n\r]+//g;
$s = ${EscHTML($s)};
- $s =~ s/\b([\w-]+)\b/defined($Hosts->{$1})
+ $s =~ s/\b([\w-.]+)\b/defined($Hosts->{$1})
? ${HostLink($1)} : $1/eg;
$c .= $s . "\n";
}
$s =~ s[(\$Conf\{.*?\})][
my $c = $1;
my $s = lc($c);
- $s =~ s{(\W)}{sprintf("%%%02x", ord($1) )}gxe;
+ $s =~ s{(\W)}{_}g;
"<a href=\"?action=view&type=docs#item_$s\"><tt>$c</tt></a>"
]eg;
$c .= $s . "\n";
TarFullArgs => "boolean",
TarIncrArgs => "boolean",
TarClientCmd => "boolean",
+ TarClientPath => "boolean",
TarClientRestoreCmd => "boolean",
RsyncShareName => "boolean",
RsyncdClientPort => "boolean",
RsyncArgs => "boolean",
RsyncRestoreArgs => "boolean",
RsyncClientCmd => "boolean",
+ RsyncClientPath => "boolean",
RsyncClientRestoreCmd => "boolean",
ArchiveDest => "boolean",
ArchiveComp => "boolean",
#
#========================================================================
#
-# Version 3.0.0beta2, released 11 Nov 2006.
+# Version 3.0.0beta3, released 3 Dec 2006.
#
# See http://backuppc.sourceforge.net.
#
my $bpc = bless {
%$paths,
- Version => '3.0.0beta2',
+ Version => '3.0.0beta3',
}, $class;
$bpc->{storage} = BackupPC::Storage->new($paths);
if ( length($na) >= 5 && length($nb) >= 5 ) {
#
- # Both new style. Bigger numbers are more recent.
+ # Both new style: format is MMYYYY. Bigger dates are
+ # more recent.
#
- return $nb - $na;
+ my $ma = $2 * 12 + $1 if ( $na =~ /(\d+)(\d{4})/ );
+ my $mb = $2 * 12 + $1 if ( $nb =~ /(\d+)(\d{4})/ );
+ return $mb - $ma;
} elsif ( length($na) >= 5 && length($nb) < 5 ) {
return -1;
} elsif ( length($na) < 5 && length($nb) >= 5 ) {
#
#========================================================================
#
-# Version 3.0.0beta2, released 11 Nov 2006.
+# Version 3.0.0beta3, released 3 Dec 2006.
#
# See http://backuppc.sourceforge.net.
#
my $mesg;
if ( sysread($t->{pipeTar}, $mesg, 8192) <= 0 ) {
vec($$FDreadRef, fileno($t->{pipeTar}), 1) = 0;
- if ( !close($t->{pipeTar}) ) {
+ if ( !close($t->{pipeTar}) && $? != 256 ) {
+ #
+ # Tar 1.16 uses exit status 1 (256) when some files
+ # changed during archive creation. We allow this
+ # as a benign error and consider the archive ok
+ #
$t->{tarOut} .= "Tar exited with error $? ($!) status\n";
$t->{xferOK} = 0 if ( !$t->{tarBadExitOk} );
}
#
alarm($conf->{ClientTimeout}) if ( !$t->{abort} );
$t->{lastOutputLine} = $_ if ( !/^$/ );
- if ( /^Total bytes written: / ) {
+ if ( /^Total bytes (written|read): / ) {
$t->{XferLOG}->write(\"$_\n") if ( $t->{logLevel} >= 1 );
$t->{xferOK} = 1;
} elsif ( /^\./ ) {
umask(0022);
-my $Version = "3.0.0beta3";
-my $ReleaseDate = "3 Dec 2006";
+my $Version = "3.0.0";
+my $ReleaseDate = "21 Jan 2007";
my $DistDir = "dist/BackupPC-$Version";
my @PerlSrc = qw(
s/__RELEASEDATE__/$ReleaseDate/g;
if ( $file =~ /BackupPC\.html$/ ) {
#
- # fixup for perl 5.6.x
+ # fixup for conf links
#
- if ( !/A NAME="item_(%|_)24Conf/i ) {
+ if ( !/A NAME="item_(%|_)conf/i ) {
s/\$Conf{([^}]*)}/
defined($ConfName{$1})
- ? "\L<A HREF=\"#$ConfName{$1}\">\E\$Conf{$1}<\/A>"
+ ? "\L<a href=\"#$ConfName{$1}\">\E\$Conf{$1}<\/A>"
: "\$Conf{$1}"/eg;
}
- s/<(A NAME="item_(%|_)24Conf(%|_)7B(.*?)(%|_)7D).*?">/\L<A NAME="item_%24Conf%7b$4%7d">/ig;
s/^<DD>/<DD><P>/;
- #
- # Fixup for perl 5.8.x first one no longer needed after
- # fix in CSS)
- #
-# if ( /^<\/dt>/ ) {
-# $_ .= <FILE>;
-# s/^(<\/dt>\n<dd>)/$1<p>/s;
-# }
s/^<li><\/li>/<li>/;
}
if ( /__CONFIGPOD__/ ) {
s/([^;])\s*$/$1 .../;
}
push(@conf, $_);
- my $text = "\$Conf{$var}";
- $text =~ s/\s+/_/sg;
- $text =~ s{(\W)}{sprintf("%%%02X", ord($1) )}gxe;
- $text = substr($text, 0, 50);
+ my $text = "_conf_${var}_";
+ $text =~ s{[\W\s]}{_}g;
$ConfName{$var} = "item_$text";
} elsif ( /^$/ ) {
if ( $str ne "" && @conf ) {