trash and then goes back to sleep, rather than continually trying.
* Moved correct user (uid) check into BackupPC::Lib so that all
applications do a user check if $Cong{BackupPCUserVerify} is
set. The avoids the risk of manually running BackupPC_dump as
the wrong user.
* Loss of blackout now applies to "host not found" as well as no ping.
Reported by Dale Renton.
* "Host not found" is now treated in a similar manner to "no ping".
* Fixed directory browsing and top-level directory browsing in 2.0.0beta0.
Reported by several users.
-* Added suse-linux init.d script from Leon Letto.
-
-* Added Gentoo linux init.d script from Tim Demarest.
-
-* Applied additional i18n strings from GFK and the translation team.
-
-* Fixed option parsing so that getopts errors are reported and we exit.
-
-* Changed reporting of Xfer PIDs so that rsync cancel works correctly.
-
* Added -v option to BackupPC_dump for verbose output (useful when
you run the command manually). Added messages for all exits.
* Fixed command queue CGI display; submitted by Tim Demarest.
+* BackupPC_trashClean now logs an error if it can't remove all the
+ trash and then goes back to sleep, rather than continually trying.
+
+* Moved correct user (uid) check into BackupPC::Lib so that all
+ applications do a user check if $Cong{BackupPCUserVerify} is
+ set. The avoids the risk of manually running BackupPC_dump as
+ the wrong user.
+
+* Loss of blackout now applies to "host not found" as well as no ping.
+ Reported by Dale Renton.
+
+* "Host not found" is now treated in a similar manner to "no ping".
+
+* Added suse-linux init.d script from Leon Letto.
+
+* Added Gentoo linux init.d script from Tim Demarest.
+
+* Applied additional i18n strings from GFK and the translation team.
+
+* Fixed option parsing so that getopts errors are reported and we exit.
+
+* Changed reporting of Xfer PIDs so that rsync cancel works correctly.
+
#------------------------------------------------------------------------
# Version 2.0.0beta1, 30 Mar 2003
#------------------------------------------------------------------------
+* Added Spanish translation es.pm from Javier Gonzalez.
+
+* Fixed CGI browse navigation bug that causes BackupPC_Admin to wedge
+ when directories were selected in a certain order.
+
+* Added binmode(STDIN) to BackupPC_tarExtract, suggested by Pat LoPresti
+ to fix a problem a RedHat8 with perl 5.8.0. It's unclear why this
+ helps, but it should be benign. See:
+ http://sourceforge.net/mailarchive/forum.php?thread_id=1853018&forum_id=503
+
+#------------------------------------------------------------------------
+# Version 2.0.0beta0, 23 Feb 2003
+#------------------------------------------------------------------------
+
* Support for rsync and rsyncd backup and restore. Changes to
BackupPC_dump, BackupPC_restore, and new modules BackupPC::Xfer::Rsync
and BackupPC::Xfer::RsyncFileIO.
now supports English and French, and adding more languages is
now easy. New config paramater $Conf{Language} sets the language.
-* Added Spanish translation es.pm from Javieri Gonzalez.
-
* Added optional user-defined pre/post dump/restore commands, allowing
things like database shutdown/startup for dumps.
* Added catching of SIG_PIPE to BackupPC_dump, and changed catch_signal
to ignore multiple signals of the same type.
-* Added binmode(STDIN) to BackupPC_tarExtract, suggested by Pat LoPresti
- to fix a problem a RedHat8 with perl 5.8.0. It's unclear why this
- helps, but it should be benign. See:
- http://sourceforge.net/mailarchive/forum.php?thread_id=1853018&forum_id=503
-
* Added reporting of the largest number of hardlinks in the pool to the
log file.
#
#========================================================================
#
-# Version 2.0.0beta1, released 30 Mar 2003.
+# Version 2.0.0beta2, released 13 Apr 2003.
#
# See http://backuppc.sourceforge.net.
#
}
$Status{$host}{activeJob} = 0;
}
+ foreach my $host ( sort(keys(%Status)) ) {
+ next if ( defined($Hosts->{$host}) );
+ delete($Status{$host});
+ }
#
# Write out our initial status and save our PID
vec($FDread, $Jobs{$host}{fn}, 1) = 1;
$Jobs{$host}{startTime} = time;
$Jobs{$host}{reqTime} = $req->{reqTime};
+ $Jobs{$host}{userReq} = $req->{userReq};
$Jobs{$host}{cmd} = join(" ", $progName, @args);
$Jobs{$host}{user} = $user;
$Jobs{$host}{type} = $type;
+ $Status{$host}{userReq} = $req->{userReq}
+ if ( defined($Hosts->{$host}) );
if ( !$req->{dhcp} ) {
$Status{$host}{state} = "Status_".$type."_starting";
$Status{$host}{activeJob} = 1;
$Status{$host}{dhcpCheckCnt}--
if ( $Status{$host}{dhcpCheckCnt} > 0 );
} elsif ( $mesg =~ /^no ping response/
- || $mesg =~ /^ping too slow/ ) {
+ || $mesg =~ /^ping too slow/
+ || $mesg =~ /^host not found/ ) {
$Status{$host}{state} = "Status_idle";
- if ( $Status{$host}{reason} ne "Reason_backup_failed" ) {
+ if ( $Status{$host}{userReq}
+ || $Status{$host}{reason} ne "Reason_backup_failed"
+ || $Status{$host}{error} =~ /^aborted by user/ ) {
$Status{$host}{reason} = "Reason_no_ping";
+ $Status{$host}{error} = $mesg;
$Status{$host}{startTime} = time;
}
$Status{$host}{deadCnt}++;
user => $user,
reqTime => time,
doFull => $doFull,
+ userReq => 1,
dhcp => $hostIP eq $host ? 0 : 1,
});
$UserQueueOn{$hostIP} = 1;
reqTime => time,
dhcp => 0,
restore => 1,
+ userReq => 1,
});
$UserQueueOn{$host} = 1;
if ( defined($Jobs{$host}) ) {
#
#========================================================================
#
-# Version 2.0.0beta1, released 30 Mar 2003.
+# Version 2.0.0beta2, released 13 Apr 2003.
#
# See http://backuppc.sourceforge.net.
#
#
#========================================================================
#
-# Version 2.0.0beta1, released 30 Mar 2003.
+# Version 2.0.0beta2, released 13 Apr 2003.
#
# See http://backuppc.sourceforge.net.
#
print("Name server doesn't know about $host; trying NetBios\n")
if ( $opts{v} );
if ( !defined($hostIP = $bpc->NetBiosHostIPFind($host)) ) {
- print(LOG $bpc->timeStamp,
- "dump failed: Can't find host $host\n");
- print("dump failed: Can't find host $host\n");
+ print(LOG $bpc->timeStamp, "Can't find host $host via netbios\n");
+ print("host not found\n");
exit(1);
}
} else {
#
#========================================================================
#
-# Version 2.0.0beta1, released 30 Mar 2003.
+# Version 2.0.0beta2, released 13 Apr 2003.
#
# See http://backuppc.sourceforge.net.
#
#
#========================================================================
#
-# Version 2.0.0beta1, released 30 Mar 2003.
+# Version 2.0.0beta2, released 13 Apr 2003.
#
# See http://backuppc.sourceforge.net.
#
#
#========================================================================
#
-# Version 2.0.0beta1, released 30 Mar 2003.
+# Version 2.0.0beta2, released 13 Apr 2003.
#
# See http://backuppc.sourceforge.net.
#
#
#========================================================================
#
-# Version 2.0.0beta1, released 30 Mar 2003.
+# Version 2.0.0beta2, released 13 Apr 2003.
#
# See http://backuppc.sourceforge.net.
#
#
#========================================================================
#
-# Version 2.0.0beta1, released 30 Mar 2003.
+# Version 2.0.0beta2, released 13 Apr 2003.
#
# See http://backuppc.sourceforge.net.
#
#
#========================================================================
#
-# Version 2.0.0beta1, released 30 Mar 2003.
+# Version 2.0.0beta2, released 13 Apr 2003.
#
# See http://backuppc.sourceforge.net.
#
#
#========================================================================
#
-# Version 2.0.0beta1, released 30 Mar 2003.
+# Version 2.0.0beta2, released 13 Apr 2003.
#
# See http://backuppc.sourceforge.net.
#
#
#========================================================================
#
-# Version 2.0.0beta1, released 30 Mar 2003.
+# Version 2.0.0beta2, released 13 Apr 2003.
#
# See http://backuppc.sourceforge.net.
#
###########################################################################
while ( 1 ) {
print("processState running\n");
- 1 while ( $bpc->RmTreeTrashEmpty("$TopDir/trash") );
+ if ( $bpc->RmTreeTrashEmpty("$TopDir/trash") < 0 ) {
+ print("log BackupPC_trashClean failed to empty $TopDir/trash\n");
+ }
print("processState idle\n");
sleep($Conf{TrashCleanSleepSec} || 300);
}
#
#========================================================================
#
-# Version 2.0.0beta1, released 30 Mar 2003.
+# Version 2.0.0beta2, released 13 Apr 2003.
#
# See http://backuppc.sourceforge.net.
#
#
#========================================================================
#
-# Version 2.0.0beta1, released 30 Mar 2003.
+# Version 2.0.0beta2, released 13 Apr 2003.
#
# See http://backuppc.sourceforge.net.
#
#
#========================================================================
#
-# Version 2.0.0beta1, released 30 Mar 2003.
+# Version 2.0.0beta2, released 13 Apr 2003.
#
# See http://backuppc.sourceforge.net.
#
}
foreach my $host ( sort(keys(%Status)) ) {
my($fullDur, $incrCnt, $incrAge, $fullSize, $fullRate, $reasonHilite);
+ my($shortErr);
my @Backups = $bpc->BackupInfoRead($host);
my $fullCnt = $incrCnt = 0;
my $fullAge = $incrAge = -1;
$incrAge = " " if ( $incrAge eq "" );
$reasonHilite = $Conf{CgiStatusHilightColor}{$Status{$host}{reason}};
$reasonHilite = " bgcolor=\"$reasonHilite\"" if ( $reasonHilite ne "" );
+ if ( $Status{$host}{state} ne "Status_backup_in_progress"
+ && $Status{$host}{state} ne "Status_restore_in_progress"
+ && $Status{$host}{error} ne "" ) {
+ ($shortErr = $Status{$host}{error}) =~ s/(.{48}).*/$1.../;
+ $shortErr = " ($shortErr)";
+ }
$str = <<EOF;
<tr$reasonHilite><td> ${HostLink($host)} </td>
- <td align="center"> ${UserLink($Hosts->{$host}{user})} </td>
+ <td align="center"> ${UserLink(defined($Hosts->{$host})
+ ? $Hosts->{$host}{user} : "")} </td>
<td align="center"> $fullCnt </td>
<td align="center"> $fullAge </td>
<td align="center"> $fullSize </td>
<td align="center"> $incrCnt </td>
<td align="center"> $incrAge </td>
<td align="center"> $Lang->{$Status{$host}{state}} </td>
- <td> $Lang->{$Status{$host}{reason}} </td></tr>
+ <td> $Lang->{$Status{$host}{reason}}$shortErr </td></tr>
EOF
if ( @Backups == 0 ) {
$hostCntNone++;
}
$statusStr .= eval("qq{$Lang->{Last_status_is_state_StatusHost_state_reason_as_of_startTime}}");
- if ( $StatusHost{error} ne "" ) {
+ if ( $StatusHost{state} ne "Status_backup_in_progress"
+ && $StatusHost{state} ne "Status_restore_in_progress"
+ && $StatusHost{error} ne "" ) {
$statusStr .= eval("qq{$Lang->{Last_error_is____EscHTML_StatusHost_error}}");
}
my $priorStr = "Pings";
$jobStr .= <<EOF;
<tr><td> ${HostLink($host)} </td>
<td align="center"> $Jobs{$host}{type} </td>
- <td align="center"> ${UserLink($Hosts->{$host}{user})} </td>
+ <td align="center"> ${UserLink(defined($Hosts->{$host})
+ ? $Hosts->{$host}{user} : "")} </td>
<td> $startTime </td>
<td> $cmd </td>
<td align="center"> $Jobs{$host}{pid} </td>
}
foreach my $host ( sort(keys(%Status)) ) {
next if ( $Status{$host}{reason} ne "Reason_backup_failed"
- || $Status{$host}{error} =~ /^Can't find host \Q$host/ );
+ && (!$Status{$host}{userReq}
+ || $Status{$host}{reason} ne "Reason_no_ping") );
my $startTime = timeStamp2($Status{$host}{startTime});
my($errorTime, $XferViewStr);
if ( $Status{$host}{errorTime} > 0 ) {
$statusStr .= <<EOF;
<tr><td> ${HostLink($host)} </td>
<td align="center"> $Status{$host}{type} </td>
- <td align="center"> ${UserLink($Hosts->{$host}{user})} </td>
+ <td align="center"> ${UserLink(defined($Hosts->{$host})
+ ? $Hosts->{$host}{user} : "")} </td>
<td align="right"> $startTime </td>
<td> $XferViewStr </td>
<td align="right"> $errorTime </td>
my($host) = @_;
my $ipAddr = $host;
- if ( $Hosts->{$host}{dhcp}
+ if ( defined($Hosts->{$host}) && $Hosts->{$host}{dhcp}
&& $ENV{REMOTE_ADDR} =~ /^(\d+[\.\d]*)$/ ) {
$ipAddr = $1;
my($netBiosHost, $netBiosUser) = $bpc->NetBiosInfoGet($ipAddr);
# $pingPath path to ping ($Conf{PingPath})
# $host host name
#
+# Wade Brown reports that on solaris 2.6 and 2.7 ping -s returns the wrong
+# exit status (0 even on failure). Replace with "ping $host 1", which
+# gets the correct exit status but we don't get the round-trip time.
+#
$Conf{PingCmd} = '$pingPath -c 1 $host';
#
#
# Language to use. See lib/BackupPC/Lang for the list of supported
-# languages, which include English (en), French (fr), and Spanish (es).
+# languages, which include English (en), French (fr), Spanish (es),
+# and German (de).
+#
# Currently the Language setting applies to the CGI interface and email
# messages sent to users. Log files and other text is still in English.
#
#
#========================================================================
#
-# Version 2.0.0beta1, released 30 Mar 2003.
+# Version 2.0.0beta2, released 13 Apr 2003.
#
# See http://backuppc.sourceforge.net.
#
#
#========================================================================
#
-# Version 2.0.0beta1, released 30 Mar 2003.
+# Version 2.0.0beta2, released 13 Apr 2003.
#
# See http://backuppc.sourceforge.net.
#
#!/usr/bin/perl -T
-
+#
+# by Manfred Herrmann (V1.1) (some typo errors + 3 new strings)
+# CVS-> Revision ???
+#
#my %lang;
#use strict;
<input type="hidden" name="doit" value="1">
Möchten Sie das wirklich tun?
<input type="submit" value="\$In{action}" name="action">
-<input type="submit" value="No" name="">
+<input type="submit" value="Nein" name="">
</form>
EOF
# --------------------------------
<p>
Möchten Sie das wirklich tun?
<input type="submit" value="\$In{action}" name="action">
-<input type="submit" value="No" name="">
+<input type="submit" value="Nein" name="">
</form>
EOF
\$hiddenStr
Wollen Sie das wirklich tun?
<input type="submit" value="\$In{action}" name="action">
-<input type="submit" value="No" name="">
+<input type="submit" value="Nein" name="">
</form>
EOF
$Lang{This_PC_has_never_been_backed_up} = "<h2> Dieser Computer wurde nie gesichert!! </h2>\n";
$Lang{This_PC_is_used_by} = "<li>Dieser Computer wird betreut von \${UserLink(\$user)}";
-$Lang{Extracting_only_Errors} = "(Extracting only Errors)";
+$Lang{Extracting_only_Errors} = "(nur Fehler anzeigen)";
$Lang{XferLOG} = "XferLOG";
-$Lang{Errors} = "Errors";
+$Lang{Errors} = "Fehler";
# ------------
$Lang{Last_email_sent_to__was_at___subject} = <<EOF;
Ihr Computer ($host) wurde durch den BackupServer noch nie erfolgreich gesichert.
-Backups sollten automatisch erfolgen, wenn Ihr Computer am Netzwerk angschlossen ist.
+Backups sollten automatisch erfolgen, wenn Ihr Computer am Netzwerk angeschlossen ist.
Sie sollten Ihren Backup-Betreuer oder den IT-Dienstleister kontaktieren, wenn:
- Ihr Computer regelmäßig am Netzwerk angeschlossen ist. Dann handelt es sich
Ihr Computer wurde von vor $firstTime Tagen bis vor $days Tagen $numBackups mal
erfolgreich gesichert.
-Backups sollten automatisch erfolgen, wenn Ihr Computer am Netzwerk angschlossen ist.
+Backups sollten automatisch erfolgen, wenn Ihr Computer am Netzwerk angeschlossen ist.
Wenn Ihr Computer in den letzten $days Tagen mehr als ein paar Stunden am
Netzwerk angeschlossen war, sollten Sie Ihren Backup-Betreuer oder
Andernfalls, wenn Sie z. B. lange Zeit nicht im Büro sind, können Sie höchstens
manuell Ihre Dateien sichern (evtl. kopieren auf eine externe Festplatte).
-Bitte denken Sie daran, dass alle in den letzten $days Tagen gänderten Dateien (z. B.
+Bitte denken Sie daran, dass alle in den letzten $days Tagen geänderten Dateien (z. B.
auch e-mails und Anhänge oder Datenbankeinträge) verloren gehen falls Ihre
Festplatte einen crash erleidet oder Dateien durch versehentliches Löschen oder
Virenbefall unbrauchbar werden.
$Lang{This_PC_has_never_been_backed_up} = "<h2> !Nunca se ha hecho copia de seguridad de este PC! </h2>\n";
$Lang{This_PC_is_used_by} = "<li>This PC es utilizado por \${UserLink(\$user)}";
-$Lang{Extracting_only_Errors} = "(Extracting only Errors)";
-$Lang{XferLOG} = "XferLOG";
-$Lang{Errors} = "Errors";
+$Lang{Extracting_only_Errors} = "(Extrayendo sólo Errores)";
+$Lang{XferLOG} = "TransfREG";
+$Lang{Errors} = "Errores";
# ------------
$Lang{Last_email_sent_to__was_at___subject} = <<EOF;
#
#========================================================================
#
-# Version 2.0.0beta1, released 30 Mar 2003.
+# Version 2.0.0beta2, released 13 Apr 2003.
#
# See http://backuppc.sourceforge.net.
#
TopDir => $topDir || '/data/BackupPC',
BinDir => $installDir || '/usr/local/BackupPC',
LibDir => $installDir || '/usr/local/BackupPC',
- Version => '2.0.0beta1',
+ Version => '2.0.0beta2',
BackupFields => [qw(
num type startTime endTime
nFiles size nFilesExist sizeExist nFilesNew sizeNew
print(STDERR $error, "\n");
return;
}
+ #
+ # Verify we are running as the correct user
+ #
+ if ( $bpc->{Conf}{BackupPCUserVerify}
+ && $> != (my $uid = (getpwnam($bpc->{Conf}{BackupPCUser}))[2]) ) {
+ print("Wrong user: my userid is $>, instead of $uid"
+ . " ($bpc->{Conf}{BackupPCUser})\n");
+ return;
+ }
return $bpc;
}
}
#
-# Empty the trash directory. Returns 0 if it did nothing.
+# Empty the trash directory. Returns 0 if it did nothing, 1 if it
+# did something, -1 if it failed to remove all the files.
#
sub RmTreeTrashEmpty
{
$cwd = $1 if ( $cwd =~ /(.*)/ );
return if ( !-d $trashDir );
- my $d = DirHandle->new($trashDir)
- or carp "Can't read $trashDir: $!";
+ my $d = DirHandle->new($trashDir) or carp "Can't read $trashDir: $!";
@files = $d->read;
$d->close;
@files = grep $_!~/^\.{1,2}$/, @files;
return 0 if ( !@files );
$bpc->RmTreeQuiet($trashDir, \@files);
+ foreach my $f ( @files ) {
+ return -1 if ( -e $f );
+ }
chdir($cwd) if ( $cwd );
return 1;
}
#
#========================================================================
#
-# Version 2.0.0beta1, released 30 Mar 2003.
+# Version 2.0.0beta2, released 13 Apr 2003.
#
# See http://backuppc.sourceforge.net.
#
#
#========================================================================
#
-# Version 2.0.0beta1, released 30 Mar 2003.
+# Version 2.0.0beta2, released 13 Apr 2003.
#
# See http://backuppc.sourceforge.net.
#
$RsyncLibOK = 0;
$RsyncLibErr = "File::RsyncP module doesn't exist";
} else {
- if ( $File::RsyncP::VERSION < 0.30 ) {
+ if ( $File::RsyncP::VERSION < 0.41 ) {
$RsyncLibOK = 0;
- $RsyncLibErr = "File::RsyncP module version too old: need 0.30";
+ $RsyncLibErr = "File::RsyncP module version too old: need 0.41";
} else {
$RsyncLibOK = 1;
}
#
#========================================================================
#
-# Version 2.0.0beta1, released 30 Mar 2003.
+# Version 2.0.0beta2, released 13 Apr 2003.
#
# See http://backuppc.sourceforge.net.
#
#
my $data;
$fio->{rxInData} = "";
- while ( $fh->read(\$data, 30 * 1024 * 1024) > 0 ) {
+ while ( $fh->read(\$data, 16 * 1024 * 1024) > 0 ) {
$fio->{rxInData} .= $data;
}
$fio->log("$attr->{fullPath}: cached all $attr->{size}"
#
#========================================================================
#
-# Version 2.0.0beta1, released 30 Mar 2003.
+# Version 2.0.0beta2, released 13 Apr 2003.
#
# See http://backuppc.sourceforge.net.
#
#
#========================================================================
#
-# Version 2.0.0beta1, released 30 Mar 2003.
+# Version 2.0.0beta2, released 13 Apr 2003.
#
# See http://backuppc.sourceforge.net.
#
#
#========================================================================
#
-# Version 2.0.0beta1, released 30 Mar 2003.
+# Version 2.0.0beta2, released 13 Apr 2003.
#
# See http://backuppc.sourceforge.net.
#
umask(0022);
my $Version = "2.0.0beta2";
-my $ReleaseDate = "13 Apr 2003";
+my $ReleaseDate = "11 May 2003";
my $DistDir = "dist/BackupPC-$Version";
my @PerlSrc = qw(