From 2c14784ad71874ec850d189060fe63d6eb9eba95 Mon Sep 17 00:00:00 2001 From: cbarratt Date: Mon, 9 Feb 2004 01:28:46 +0000 Subject: [PATCH] Lots of changes: - rsync checksum caching (note: needs new File::RsyncP) - keeping partial full dumps - resuming of partial dumps with rsync (note: not tested!) - cleaned up new archive feature - made all language files uniform --- ChangeLog | 16 +- bin/BackupPC | 30 +- bin/BackupPC_archive | 13 +- bin/BackupPC_archiveHost | 134 ++++++++ bin/BackupPC_archivecd | 51 --- bin/BackupPC_archivetape | 45 --- bin/BackupPC_compressPool | 4 +- bin/BackupPC_dump | 37 ++- bin/BackupPC_link | 4 +- bin/BackupPC_nightly | 4 +- bin/BackupPC_restore | 5 +- bin/BackupPC_sendEmail | 9 +- bin/BackupPC_serverMesg | 4 +- bin/BackupPC_tarCreate | 138 ++++++-- bin/BackupPC_tarExtract | 36 +- bin/BackupPC_trashClean | 4 +- bin/BackupPC_zcat | 4 +- bin/BackupPC_zipCreate | 4 +- cgi-bin/BackupPC_Admin | 17 +- conf/config.pl | 48 ++- configure.pl | 4 +- lib/BackupPC/Attrib.pm | 2 +- lib/BackupPC/CGI/AdminOptions.pm | 2 +- lib/BackupPC/CGI/Archive.pm | 67 ++-- lib/BackupPC/CGI/ArchiveInfo.pm | 2 +- lib/BackupPC/CGI/Browse.pm | 2 +- lib/BackupPC/CGI/DirHistory.pm | 2 +- lib/BackupPC/CGI/EmailSummary.pm | 2 +- lib/BackupPC/CGI/GeneralInfo.pm | 2 +- lib/BackupPC/CGI/HostInfo.pm | 6 +- lib/BackupPC/CGI/LOGlist.pm | 5 +- lib/BackupPC/CGI/Lib.pm | 6 +- lib/BackupPC/CGI/Queue.pm | 2 +- lib/BackupPC/CGI/ReloadServer.pm | 9 +- lib/BackupPC/CGI/Restore.pm | 56 +++- lib/BackupPC/CGI/RestoreFile.pm | 2 +- lib/BackupPC/CGI/RestoreInfo.pm | 2 +- lib/BackupPC/CGI/StartServer.pm | 2 +- lib/BackupPC/CGI/StartStopBackup.pm | 5 +- lib/BackupPC/CGI/StopServer.pm | 2 +- lib/BackupPC/CGI/Summary.pm | 2 +- lib/BackupPC/CGI/View.pm | 29 +- lib/BackupPC/FileZIO.pm | 45 ++- lib/BackupPC/Lang/de.pm | 490 +++++++++++++++++++++------- lib/BackupPC/Lang/en.pm | 147 +++++---- lib/BackupPC/Lang/es.pm | 483 ++++++++++++++++++++------- lib/BackupPC/Lang/fr.pm | 224 +++++++------ lib/BackupPC/Lib.pm | 16 +- lib/BackupPC/PoolWrite.pm | 2 +- lib/BackupPC/RsyncDigest.pm | 280 ++++++++++++++++ lib/BackupPC/View.pm | 73 ++++- lib/BackupPC/Xfer/Archive.pm | 58 ++-- lib/BackupPC/Xfer/Rsync.pm | 9 +- lib/BackupPC/Xfer/RsyncFileIO.pm | 234 +++++++------ lib/BackupPC/Xfer/Smb.pm | 53 +-- lib/BackupPC/Xfer/Tar.pm | 3 +- lib/BackupPC/Zip/FileMember.pm | 2 +- makeDist | 7 +- 58 files changed, 2098 insertions(+), 848 deletions(-) create mode 100755 bin/BackupPC_archiveHost delete mode 100644 bin/BackupPC_archivecd delete mode 100644 bin/BackupPC_archivetape create mode 100644 lib/BackupPC/RsyncDigest.pm diff --git a/ChangeLog b/ChangeLog index 5eca062..605c323 100644 --- a/ChangeLog +++ b/ChangeLog @@ -21,6 +21,21 @@ # Version __VERSION__, __RELEASEDATE__ #------------------------------------------------------------------------ +* Added support for resuming a full dump for rsync. The partial + full is kept, and to resume an incremental is done against the + partial, and a full is done for the rest. + +* Added support for Rsync checksum caching. Rsync checksum are + appended to the compressed pool files. + +* Added support for smbclient from samba version 3.0.0. + +* Added options for block size, buffer size and share wild-card to + BackupPC_tarCreate. + +* Add creation of per-PC directory in BackupPC/CGI/Restore.pm in + case it doesn't already exist. Reported by XXX. + * Replace PingClientPath with PingPath in configure.pl. * GFK updated fr.pm from en.pm. @@ -107,7 +122,6 @@ fixes large file (>2GB) bugs. Large file bugs reported by Steve Waltner. - #------------------------------------------------------------------------ # Version 2.0.0, 14 Jun 2003 #------------------------------------------------------------------------ diff --git a/bin/BackupPC b/bin/BackupPC index 3f1fa2b..61276e2 100755 --- a/bin/BackupPC +++ b/bin/BackupPC @@ -1,4 +1,4 @@ -#!/bin/perl -T +#!/bin/perl #============================================================= -*-perl-*- # # BackupPC: Main program for PC backups. @@ -47,7 +47,7 @@ # #======================================================================== # -# Version 2.1.0_CVS, released 3 Jul 2003. +# Version 2.1.0_CVS, released 8 Feb 2004. # # See http://backuppc.sourceforge.net. # @@ -818,6 +818,17 @@ sub Main_Check_Job_Messages $Status{$host}{startTime} = time; $Status{$host}{deadCnt} = 0; $Status{$host}{aliveCnt}++; + } elsif ( $mesg =~ /^started_archive/ ) { + $Jobs{$host}{type} = "archive"; + print(LOG $bpc->timeStamp, + "Started archive on $host" + . " (pid=$Jobs{$host}{pid})\n"); + $Status{$host}{state} = "Status_archive_in_progress"; + $Status{$host}{reason} = ""; + $Status{$host}{type} = "archive"; + $Status{$host}{startTime} = time; + $Status{$host}{deadCnt} = 0; + $Status{$host}{aliveCnt}++; } elsif ( $mesg =~ /^(full|incr) backup complete/ ) { print(LOG $bpc->timeStamp, "Finished $1 backup on $host\n"); $Status{$host}{reason} = "Reason_backup_done"; @@ -830,6 +841,12 @@ sub Main_Check_Job_Messages delete($Status{$host}{error}); delete($Status{$host}{errorTime}); $Status{$host}{endTime} = time; + } elsif ( $mesg =~ /^archive complete/ ) { + print(LOG $bpc->timeStamp, "Finished archive on $host\n"); + $Status{$host}{reason} = "Reason_archive_done"; + delete($Status{$host}{error}); + delete($Status{$host}{errorTime}); + $Status{$host}{endTime} = time; } elsif ( $mesg =~ /^nothing to do/ ) { if ( $Status{$host}{reason} ne "Reason_backup_failed" && $Status{$host}{reason} ne "Reason_restore_failed" ) { @@ -868,6 +885,13 @@ sub Main_Check_Job_Messages $Status{$host}{errorTime} = time; $Status{$host}{endTime} = time; print(LOG $bpc->timeStamp, "Restore failed on $host ($1)\n"); + } elsif ( $mesg =~ /^archive failed: (.*)/ ) { + $Status{$host}{state} = "Status_idle"; + $Status{$host}{reason} = "Reason_archive_failed"; + $Status{$host}{error} = $1; + $Status{$host}{errorTime} = time; + $Status{$host}{endTime} = time; + print(LOG $bpc->timeStamp, "Archive failed on $host ($1)\n"); } elsif ( $mesg =~ /^log\s+(.*)/ ) { print(LOG $bpc->timeStamp, "$1\n"); } elsif ( $mesg =~ /^BackupPC_stats = (.*)/ ) { @@ -1225,7 +1249,7 @@ sub Main_Check_Client_Messages } elsif ( $cmd =~ /^server\s+(\w+)/ ) { my($type) = $1; if ( $type eq 'reload' ) { - ServerReload("Reloading server configuration..."); + ServerReload("Reloading config/host files via CGI request"); } elsif ( $type eq 'shutdown' ) { $reply = "Shutting down...\n"; syswrite($Clients{$client}{fh}, $reply, length($reply)); diff --git a/bin/BackupPC_archive b/bin/BackupPC_archive index 3a3bea4..c61e5cf 100644 --- a/bin/BackupPC_archive +++ b/bin/BackupPC_archive @@ -1,4 +1,4 @@ -#!/bin/perl -T +#!/bin/perl #============================================================= -*-perl-*- # # BackupPC_archive: Archive files for an archive client. @@ -29,7 +29,7 @@ # #======================================================================== # -# Version 2.1.0_CVS, released 3 Jul 2003. +# Version 2.1.0_CVS, released 8 Feb 2004. # # See http://backuppc.sourceforge.net. # @@ -72,8 +72,6 @@ $reqFileName = $1; my $startTime = time(); -#my $Hosts = $bpc->HostInfoRead($client); - my $Dir = "$TopDir/pc/$client"; my @xferPid = (); @@ -113,6 +111,7 @@ if ( !(my $ret = do "$Dir/$reqFileName") ) { $stat{hostError} = $err; exit(ArchiveCleanup($client)); } + # # Re-read config file, so we can include the PC-specific config # @@ -191,7 +190,9 @@ if ( !defined($logMsg = $xfer->start()) ) { } print(LOG $bpc->timeStamp, "Starting archive\n"); +print("started_archive\n"); $xfer->run(); +$stat{xferOK} = 0 if ( defined($stat{hostError} = $xfer->errStr) ); alarm(0); exit(ArchiveCleanup($client)); @@ -277,7 +278,7 @@ sub ArchiveCleanup $stat{hostError} = $stat{lastOutputLine} if ( $stat{hostError} eq "" ); sleep(2); $stat{hostAbort} = 1; - $ArchiveLOG->write(\"Archive failed: $stat{hostError}\n") + $ArchiveLOG->write(\"Archive failed: $stat{hostError}") if ( defined($ArchiveLOG) ); } @@ -309,7 +310,7 @@ sub ArchiveCleanup return 1; } else { print(LOG $bpc->timeStamp, "Archive Complete\n"); - print("Archive Complete\n"); + print("archive complete\n"); return; } } diff --git a/bin/BackupPC_archiveHost b/bin/BackupPC_archiveHost new file mode 100755 index 0000000..3b68aa9 --- /dev/null +++ b/bin/BackupPC_archiveHost @@ -0,0 +1,134 @@ +#!/bin/perl +#============================================================= +# +# BackupPC_archiveHost: Archive files for a single host +# +# DESCRIPTION +# +# Usage: BackupPC_archiveHost tarCreatePath splitPath parPath host bkupNum \ +# compPath fileExt splitSize outLoc parFile share +# +# This script is run for each host to create an archive. +# +# This script is executed by BackupPC_archive, based on the setting +# of $Conf{ArchiveClientCmd}. This script can be copied and modified +# for site-specific behavior. Update $Conf{ArchiveClientCmd} to point +# at your customized archive script. +# +# AUTHOR +# Craig Barratt +# +# COPYRIGHT +# 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 +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +#======================================================================== +# +# Version 2.1.0_CVS, released 8 Feb 2004. +# +# See http://backuppc.sourceforge.net. +# +#======================================================================== + +use strict; +use File::Path; +use lib "/usr/local/BackupPC/lib"; +use BackupPC::Lib; + +# +# Pick up the command-line arguments +# +if ( @ARGV != 11 ) { + print <new failed\n") if ( !(my $bpc = BackupPC::Lib->new) ); + +# +# Make sure the specified programs are executable +# +foreach my $prog ( ($tarCreate, $compPath, $splitPath, $parPath) ) { + next if ( $prog eq "" || -x $prog ); + print("Error: $prog is not an executable program\n"); + exit(1); +} +my $mesg = "Writing tar archive for host $host, backup #$bkupNum"; + +# +# Build the command we will run +# +$share = $bpc->shellEscape($share); +$host = $bpc->shellEscape($host); +my $cmd = "$tarCreate -t -h $host -n $bkupNum -s $share . "; +$cmd .= "| $compPath " if ( $compPath ne "cat" && $compPath ne "" ); +if ( -b $outLoc || -c $outLoc || -f $outLoc ) { + # + # Output file is a device or a regular file, so don't use split + # + $cmd .= ">> $outLoc"; + $mesg .= " to $outLoc"; +} else { + mkpath($outLoc) if ( !-d $outLoc ); + if ( !-d $outLoc ) { + print("Error: unable to create output directory $outLoc\n"); + exit(1); + } + if ( $splitSize && -x $splitPath ) { + $cmd .= "| $splitPath -b $splitSize - $outLoc/$host.$bkupNum.tar$fileExt."; + $mesg .= ", split to output files $outLoc/$host.$bkupNum.tar$fileExt.*"; + } else { + $cmd .= "> $outLoc/$host.$bkupNum.tar$fileExt"; + $mesg .= " to output file $outLoc/$host.$bkupNum.tar$fileExt"; + } +} +print("$mesg\n"); + +# +# Run the command +# +my $ret = system($cmd); +if ( $ret ) { + print("Error: $tarCreate, compress or split failed\n"); + exit(1); +} + +# +# Run optional parity file generation (only if the output is a directory, +# ie: not a tape device). +# +if ( -d $outLoc && -x $parPath ) { + print("Running $parPath to create parity files\n"); + $ret = system("$parPath a -n $parfile $outLoc/$host.$bkupNum.tar$fileExt.par $outLoc/$host.$bkupNum.tar$fileExt.*"); + if ( $ret ) { + print("Error: $parPath failed\n"); + exit(1); + } +} diff --git a/bin/BackupPC_archivecd b/bin/BackupPC_archivecd deleted file mode 100644 index d9f4c0d..0000000 --- a/bin/BackupPC_archivecd +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/sh -#============================================================= -# -# BackupPC_archivecd: Archive files to a cd host -# -# DESCRIPTION -# -# Usage: BackupPC_archivecd tarCreate splitpath parpath host backupnumber compression compext splitsize archiveloc parfile share -# -# AUTHOR -# Craig Barratt -# -# COPYRIGHT -# 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 -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -#======================================================================== -# -# Version 2.1.0_CVS, released 3 Jul 2003. -# -# See http://backuppc.sourceforge.net. -# -#======================================================================== - -tarCreate=$1 -splitpath=$2 -parpath=$3 -host=$4 -backupnumber=$5 -compression=$6 -compext=$7 -splitsize=$8 -archiveloc=$9 -parfile=${10} -share=${11} - -$tarCreate -h $host -n $backupnumber -s $share $share | $compression | $splitpath -b $splitsize - $archiveloc/$host.$backupnumber.tar$compext. -$parpath a -n $parfile $archiveloc/$host.$backupnumber.tar$compext.par $archiveloc/$host.$backupnumber.tar$compext.* diff --git a/bin/BackupPC_archivetape b/bin/BackupPC_archivetape deleted file mode 100644 index 18717ab..0000000 --- a/bin/BackupPC_archivetape +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/sh -#============================================================= -# -# BackupPC_archivetape: Archive files to a tape host -# -# DESCRIPTION -# -# Usage: BackupPC_archivecd tarCreate host backupnumber compression archiveloc share -# -# AUTHOR -# Craig Barratt -# -# COPYRIGHT -# 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 -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -#======================================================================== -# -# Version 2.1.0_CVS, released 3 Jul 2003. -# -# See http://backuppc.sourceforge.net. -# -#======================================================================== - -tarCreate=$1 -host=$2 -backupnumber=$3 -compression=$4 -archiveloc=$5 -share=$6 - -$tarCreate -h $host -n $backupnumber -s $share $share | $compression > $archiveloc diff --git a/bin/BackupPC_compressPool b/bin/BackupPC_compressPool index 8e07763..f4c97a9 100755 --- a/bin/BackupPC_compressPool +++ b/bin/BackupPC_compressPool @@ -1,4 +1,4 @@ -#!/bin/perl -T +#!/bin/perl #============================================================= -*-perl-*- # # BackupPC_compressPool: Compress existing pool @@ -49,7 +49,7 @@ # #======================================================================== # -# Version 2.1.0_CVS, released 3 Jul 2003. +# Version 2.1.0_CVS, released 8 Feb 2004. # # See http://backuppc.sourceforge.net. # diff --git a/bin/BackupPC_dump b/bin/BackupPC_dump index 11fc3db..23720ca 100755 --- a/bin/BackupPC_dump +++ b/bin/BackupPC_dump @@ -1,4 +1,4 @@ -#!/bin/perl -T +#!/bin/perl #============================================================= -*-perl-*- # # BackupPC_dump: Dump a single client. @@ -70,7 +70,7 @@ # #======================================================================== # -# Version 2.1.0_CVS, released 3 Jul 2003. +# Version 2.1.0_CVS, released 8 Feb 2004. # # See http://backuppc.sourceforge.net. # @@ -270,6 +270,7 @@ my($needLink, @Backups, $type, $lastBkupNum, $lastFullBkupNum); my $lastFull = 0; my $lastIncr = 0; my $partialIdx = -1; +my $partialNum; if ( $Conf{FullPeriod} == -1 && !$opts{f} && !$opts{i} || $Conf{FullPeriod} == -2 ) { @@ -280,11 +281,32 @@ if ( !$opts{i} && !$opts{f} && $Conf{BlackoutGoodCnt} >= 0 && $StatusHost{aliveCnt} >= $Conf{BlackoutGoodCnt} ) { my($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); my($currHours) = $hour + $min / 60 + $sec / 3600; - if ( $Conf{BlackoutHourBegin} <= $currHours - && $currHours <= $Conf{BlackoutHourEnd} - && grep($_ == $wday, @{$Conf{BlackoutWeekDays}}) ) { + my $blackout; + # + # Allow blackout to span midnight (specified by BlackoutHourBegin + # being greater than BlackoutHourEnd) + # + if ( $Conf{BlackoutHourBegin} > $Conf{BlackoutHourEnd} ) { + $blackout = $Conf{BlackoutHourBegin} <= $currHours + || $currHours <= $Conf{BlackoutHourEnd}; + if ( $currHours <= $Conf{BlackoutHourEnd} ) { + # + # This is after midnight, so decrement the weekday for the + # weekday check (eg: Monday 11pm-1am means Monday 2300 to + # Tuesday 0100, not Monday 2300-2400 plus Monday 0000-0100). + # + $wday--; + $wday += 7 if ( $wday < 0 ); + } + } else { + $blackout = $Conf{BlackoutHourBegin} <= $currHours + && $currHours <= $Conf{BlackoutHourEnd}; + } + if ( $blackout && grep($_ == $wday, @{$Conf{BlackoutWeekDays}}) ) { # print(LOG $bpc->timeStamp, "skipping because of blackout" # . " (alive $StatusHost{aliveCnt} times)\n"); + print(STDERR "Skipping $client because of blackout\n") + if ( $opts{v} ); NothingToDo($needLink); } } @@ -319,6 +341,7 @@ for ( my $i = 0 ; $i < @Backups ; $i++ ) { if ( $lastIncr < $Backups[$i]{startTime} ); } elsif ( $Backups[$i]{type} eq "partial" ) { $partialIdx = $i; + $partialNum = $Backups[$i]{num}; } } @@ -384,7 +407,7 @@ if ( !defined($XferLOG) ) { print("dump failed: unable to open/create $Dir/XferLOG$fileExt\n"); exit(1); } -$XferLOG->writeTeeStdout(1) if ( $opts{v} ); +$XferLOG->writeTeeStderr(1) if ( $opts{v} ); unlink("$Dir/NewFileList"); my $startTime = time(); @@ -499,6 +522,7 @@ for my $shareName ( @$ShareNames ) { open(STDERR, ">&STDOUT"); close(STDIN); open(STDIN, "<&RH"); + alarm(0); exec("$BinDir/BackupPC_tarExtract", $client, $shareName, $Conf{CompressLevel}); print(LOG $bpc->timeStamp, @@ -537,6 +561,7 @@ for my $shareName ( @$ShareNames ) { compress => $Conf{CompressLevel}, XferMethod => $Conf{XferMethod}, pidHandler => \&pidHandler, + partialNum => $partialNum, }); if ( !defined($logMsg = $xfer->start()) ) { diff --git a/bin/BackupPC_link b/bin/BackupPC_link index d17752c..98bada9 100755 --- a/bin/BackupPC_link +++ b/bin/BackupPC_link @@ -1,4 +1,4 @@ -#!/bin/perl -T +#!/bin/perl #============================================================= -*-perl-*- # # BackupPC_link: link new backup into pool @@ -39,7 +39,7 @@ # #======================================================================== # -# Version 2.1.0_CVS, released 3 Jul 2003. +# Version 2.1.0_CVS, released 8 Feb 2004. # # See http://backuppc.sourceforge.net. # diff --git a/bin/BackupPC_nightly b/bin/BackupPC_nightly index a5b724e..e70f1ff 100755 --- a/bin/BackupPC_nightly +++ b/bin/BackupPC_nightly @@ -1,4 +1,4 @@ -#!/bin/perl -T +#!/bin/perl #============================================================= -*-perl-*- # # BackupPC_nightly: Nightly cleanup & statistics script. @@ -35,7 +35,7 @@ # #======================================================================== # -# Version 2.1.0_CVS, released 3 Jul 2003. +# Version 2.1.0_CVS, released 8 Feb 2004. # # See http://backuppc.sourceforge.net. # diff --git a/bin/BackupPC_restore b/bin/BackupPC_restore index 566673d..9ebd8c4 100755 --- a/bin/BackupPC_restore +++ b/bin/BackupPC_restore @@ -1,4 +1,4 @@ -#!/bin/perl -T +#!/bin/perl #============================================================= -*-perl-*- # # BackupPC_restore: Restore files to a client. @@ -29,7 +29,7 @@ # #======================================================================== # -# Version 2.1.0_CVS, released 3 Jul 2003. +# Version 2.1.0_CVS, released 8 Feb 2004. # # See http://backuppc.sourceforge.net. # @@ -332,6 +332,7 @@ if ( $useTar ) { open(STDERR, ">&STDOUT"); close(STDOUT); open(STDOUT, ">&WH"); + alarm(0); exec("$BinDir/BackupPC_tarCreate", @tarArgs); print(LOG $bpc->timeStamp, "can't exec $BinDir/BackupPC_tarCreate\n"); # FIX: need to cleanup xfer diff --git a/bin/BackupPC_sendEmail b/bin/BackupPC_sendEmail index d9e1c7e..cf4f627 100755 --- a/bin/BackupPC_sendEmail +++ b/bin/BackupPC_sendEmail @@ -1,4 +1,4 @@ -#!/bin/perl -T +#!/bin/perl #============================================================= -*-perl-*- # # BackupPC_sendEmail: send status emails to users and admins @@ -31,7 +31,7 @@ # #======================================================================== # -# Version 2.1.0_CVS, released 3 Jul 2003. +# Version 2.1.0_CVS, released 8 Feb 2004. # # See http://backuppc.sourceforge.net. # @@ -169,6 +169,7 @@ foreach my $host ( sort(keys(%Status)) ) { my $user = $Hosts->{$host}{user}; next if ( time - $UserEmailInfo{$user}{lastTime} < $Conf{EMailNotifyMinDays} * 24*3600 ); + next if ($Conf{XferMethod} eq "archive" ); my @Backups = $bpc->BackupInfoRead($host); my $numBackups = @Backups; if ( $numBackups == 0 ) { @@ -215,8 +216,8 @@ foreach my $host ( sort(keys(%Status)) ) { while ( 1 ) { my $s = $fh->readLine(); last if ( $s eq "" ); - if ( $s =~ /^Error reading file.*\.pst : ERRDOS - ERRlock/ - || $s =~ /^Error reading file.*\.pst\. Got 0 bytes/ ) { + if ( $s =~ /^\s*Error reading file.*\.pst : ERRDOS - ERRlock/ + || $s =~ /^\s*Error reading file.*\.pst\. Got 0 bytes/ ) { $badOutlook = 1; last; } diff --git a/bin/BackupPC_serverMesg b/bin/BackupPC_serverMesg index 52eb22a..5835bd5 100755 --- a/bin/BackupPC_serverMesg +++ b/bin/BackupPC_serverMesg @@ -1,4 +1,4 @@ -#!/bin/perl -T +#!/bin/perl #============================================================= -*-perl-*- # # BackupPC_serverMesg: Send one or more commands to the BackupPC server. @@ -43,7 +43,7 @@ # #======================================================================== # -# Version 2.1.0_CVS, released 3 Jul 2003. +# Version 2.1.0_CVS, released 8 Feb 2004. # # See http://backuppc.sourceforge.net. # diff --git a/bin/BackupPC_tarCreate b/bin/BackupPC_tarCreate index 80ba759..57a8d63 100755 --- a/bin/BackupPC_tarCreate +++ b/bin/BackupPC_tarCreate @@ -1,4 +1,4 @@ -#!/bin/perl -T +#!/bin/perl #============================================================= -*-perl-*- # # BackupPC_tarCreate: create a tar archive of an existing dump @@ -6,20 +6,23 @@ # # DESCRIPTION # -# Usage: BackupPC_tarCreate [-t] [-h host] [-n dumpNum] [-s shareName] -# [-r pathRemove] [-p pathAdd] files/directories... +# Usage: BackupPC_tarCreate [options] files/directories... # # Flags: # Required options: # -# -h host host from which the tar archive is created -# -n dumpNum dump number from which the tar archive is created -# -s shareName share name from which the tar archive is created +# -h host Host from which the tar archive is created. +# -n dumpNum Dump number from which the tar archive is created. +# A negative number means relative to the end (eg -1 +# means the most recent dump, -2 2nd most recent etc). +# -s shareName Share name from which the tar archive is created. # # Other options: # -t print summary totals # -r pathRemove path prefix that will be replaced with pathAdd # -p pathAdd new path prefix +# -b BLOCKS BLOCKS x 512 bytes per record (default 20; same as tar) +# -w writeBufSz write buffer size (default 1MB) # # The -h, -n and -s options specify which dump is used to generate # the tar archive. The -r and -p options can be used to relocate @@ -48,7 +51,7 @@ # #======================================================================== # -# Version 2.1.0_CVS, released 3 Jul 2003. +# Version 2.1.0_CVS, released 8 Feb 2004. # # See http://backuppc.sourceforge.net. # @@ -71,10 +74,23 @@ my %Conf = $bpc->Conf(); my %opts; -if ( !getopts("th:n:p:r:s:", \%opts) || @ARGV < 1 ) { - print(STDERR "usage: $0 [-t] [-h host] [-n dumpNum] [-s shareName]" - . " [-r pathRemove] [-p pathAdd]" - . " files/directories...\n"); +if ( !getopts("th:n:p:r:s:b:w:", \%opts) || @ARGV < 1 ) { + print STDERR <= @Backups ) { my $PathRemove = $1 if ( $opts{r} =~ /(.+)/ ); my $PathAdd = $1 if ( $opts{p} =~ /(.+)/ ); -if ( $opts{s} !~ /^([\w\s\.\/\$-]+)$/ ) { +if ( $opts{s} !~ /^([\w\s\.\/\$-]+)$/ && $opts{s} ne "*" ) { print(STDERR "$0: bad share name '$opts{s}'\n"); exit(1); } -my $ShareName = $opts{s}; +our $ShareName = $opts{s}; +our $view = BackupPC::View->new($bpc, $Host, \@Backups); # # This constant and the line of code below that uses it are borrowed @@ -126,9 +144,9 @@ my $tar_pack_header = 'a100 a8 a8 a8 a12 a12 A8 a1 a100 a6 a2 a32 a32 a8 a8 a155 x12'; my $tar_header_length = 512; -my $BufSize = 1048576; # 1MB or 2^20 +my $BufSize = $opts{w} || 1048576; # 1MB or 2^20 my $WriteBuf = ""; -my $WriteBufSz = 20 * $tar_header_length; +my $WriteBufSz = ($opts{b} || 20) * $tar_header_length; my(%UidCache, %GidCache); my(%HardLinkExtraFiles, @HardLinks); @@ -138,21 +156,23 @@ my(%HardLinkExtraFiles, @HardLinks); # binmode(STDOUT); my $fh = *STDOUT; -foreach my $dir ( @ARGV ) { - archiveWrite($fh, $dir); -} - -# -# Write out any hardlinks (if any) -# -foreach my $hdr ( @HardLinks ) { - $hdr->{size} = 0; - if ( defined($PathRemove) - && substr($hdr->{linkname}, 0, length($PathRemove)+1) - eq ".$PathRemove" ) { - substr($hdr->{linkname}, 0, length($PathRemove)+1) = ".$PathAdd"; +if ( $ShareName eq "*" ) { + my $PathRemoveOrig = $PathRemove; + my $PathAddOrig = $PathAdd; + foreach $ShareName ( $view->shareList($Num) ) { + #print(STDERR "Doing share ($ShareName)\n"); + $PathRemove = "/" if ( !defined($PathRemoveOrig) ); + ($PathAdd = "/$ShareName/$PathAddOrig") =~ s{//+}{/}g; + foreach my $dir ( @ARGV ) { + archiveWrite($fh, $dir); + } + archiveWriteHardLinks($fh); } - TarWriteFileInfo($fh, $hdr); +} else { + foreach my $dir ( @ARGV ) { + archiveWrite($fh, $dir); + } + archiveWriteHardLinks($fh); } # @@ -170,6 +190,13 @@ if ( $opts{t} ) { print STDERR "Done: $FileCnt files, $ByteCnt bytes, $DirCnt dirs,", " $SpecialCnt specials, $ErrorCnt errors\n"; } +if ( $ErrorCnt && !$FileCnt && !$DirCnt ) { + # + # Got errors, with no files or directories; exit with non-zero + # status + # + exit(1); +} exit(0); ########################################################################### @@ -180,15 +207,38 @@ sub archiveWrite { my($fh, $dir, $tarPathOverride) = @_; - my $view = BackupPC::View->new($bpc, $Host, \@Backups); - if ( $dir =~ m{(^|/)\.\.(/|$)} ) { print(STDERR "$0: bad directory '$dir'\n"); $ErrorCnt++; return; } - $view->find($Num, $ShareName, $dir, 0, \&TarWriteFile, - $fh, $tarPathOverride); + $dir = "/" if ( $dir eq "." ); + #print(STDERR "calling find with $Num, $ShareName, $dir\n"); + if ( $view->find($Num, $ShareName, $dir, 0, \&TarWriteFile, + $fh, $tarPathOverride) < 0 ) { + print(STDERR "$0: bad share or directory '$ShareName/$dir'\n"); + $ErrorCnt++; + return; + } +} + +# +# Write out any hardlinks (if any) +# +sub archiveWriteHardLinks +{ + my $fh = @_; + foreach my $hdr ( @HardLinks ) { + $hdr->{size} = 0; + if ( defined($PathRemove) + && substr($hdr->{linkname}, 0, length($PathRemove)+1) + eq ".$PathRemove" ) { + substr($hdr->{linkname}, 0, length($PathRemove)+1) = ".$PathAdd"; + } + TarWriteFileInfo($fh, $hdr); + } + @HardLinks = (); + %HardLinkExtraFiles = (); } sub UidLookup @@ -262,12 +312,29 @@ sub TarWriteHeader : ""; my $devminor = defined($hdr->{devminor}) ? sprintf("%07o", $hdr->{devminor}) : ""; + my $sizeStr; + if ( $hdr->{size} >= 2 * 65536 * 65536 ) { + # + # GNU extension for files >= 8GB: send size in big-endian binary + # + $sizeStr = pack("c4 N N", 0x80, 0, 0, 0, + $hdr->{size} / (65536 * 65536), + $hdr->{size} % (65536 * 65536)); + } elsif ( $hdr->{size} >= 1 * 65536 * 65536 ) { + # + # sprintf octal only handles up to 2^32 - 1 + # + my $sizeStr = sprintf("%03o", $hdr->{size} / (1 << 24)) + . sprintf("%08o", $hdr->{size} % (1 << 24)); + } else { + $sizeStr = sprintf("%011o", $hdr->{size}); + } my $data = pack($tar_pack_header, substr($hdr->{name}, 0, 99), sprintf("%07o", $hdr->{mode}), sprintf("%07o", $hdr->{uid}), sprintf("%07o", $hdr->{gid}), - sprintf("%011o", $hdr->{size}), + $sizeStr, sprintf("%011o", $hdr->{mtime}), "", #checksum field - space padded by pack("A8") $hdr->{type}, @@ -327,6 +394,7 @@ sub TarWriteFile my $tarPath = $hdr->{relPath}; $tarPath = $tarPathOverride if ( defined($tarPathOverride) ); + $tarPath =~ s{//+}{/}g; if ( defined($PathRemove) && substr($tarPath, 0, length($PathRemove)) eq $PathRemove ) { substr($tarPath, 0, length($PathRemove)) = $PathAdd; diff --git a/bin/BackupPC_tarExtract b/bin/BackupPC_tarExtract index 17e28f5..9a2872b 100755 --- a/bin/BackupPC_tarExtract +++ b/bin/BackupPC_tarExtract @@ -1,4 +1,4 @@ -#!/bin/perl -T +#!/bin/perl #============================================================= -*-perl-*- # # BackupPC_tarExtract: extract data from a dump @@ -27,7 +27,7 @@ # #======================================================================== # -# Version 2.1.0_CVS, released 3 Jul 2003. +# Version 2.1.0_CVS, released 8 Feb 2004. # # See http://backuppc.sourceforge.net. # @@ -161,9 +161,35 @@ sub TarReadFileInfo $mode = oct $mode; $uid = oct $uid; $gid = oct $gid; - $size =~ s/^6/2/; # fix bug in smbclient for >=2GB files - $size =~ s/^7/3/; # fix bug in smbclient for >=2GB files - $size = oct $size; + if ( ord($size) == 128 ) { + # + # GNU tar extension: for >=8GB files the size is stored + # in big endian binary. + # + $size = 65536 * 65536 * unpack("N", substr($size, 4, 4)) + + unpack("N", substr($size, 8, 4)); + } else { + # + # We used to have a patch here for smbclient 2.2.x. For file + # sizes between 2 and 4GB it sent the wrong size. But since + # samba 3.0.0 has been released we no longer support this + # patch since valid files could have sizes that start with + # 6 or 7 in octal (eg: 6-8GB files). + # + # $size =~ s/^6/2/; # fix bug in smbclient for >=2GB files + # $size =~ s/^7/3/; # fix bug in smbclient for >=2GB files + # + # To avoid integer overflow in case we are in the 4GB - 8GB + # range, we do the conversion in two parts. + # + if ( $size =~ /([0-9]{9,})/ ) { + my $len = length($1); + $size = oct(substr($1, 0, $len - 8)) * (1 << 24) + + oct(substr($1, $len - 8)); + } else { + $size = oct($size); + } + } $mtime = oct $mtime; $chksum = oct $chksum; $devmajor = oct $devmajor; diff --git a/bin/BackupPC_trashClean b/bin/BackupPC_trashClean index 513401c..dcfcb4e 100755 --- a/bin/BackupPC_trashClean +++ b/bin/BackupPC_trashClean @@ -1,4 +1,4 @@ -#!/bin/perl -T +#!/bin/perl #============================================================= -*-perl-*- # # BackupPC_trashClean: remove all the files in $TopDir/trash. @@ -29,7 +29,7 @@ # #======================================================================== # -# Version 2.1.0_CVS, released 3 Jul 2003. +# Version 2.1.0_CVS, released 8 Feb 2004. # # See http://backuppc.sourceforge.net. # diff --git a/bin/BackupPC_zcat b/bin/BackupPC_zcat index 4b7ffb8..d162e2f 100755 --- a/bin/BackupPC_zcat +++ b/bin/BackupPC_zcat @@ -1,4 +1,4 @@ -#!/bin/perl -T +#!/bin/perl #============================================================= -*-perl-*- # # BackupPC_zcat: uncompress files to stdout @@ -32,7 +32,7 @@ # #======================================================================== # -# Version 2.1.0_CVS, released 3 Jul 2003. +# Version 2.1.0_CVS, released 8 Feb 2004. # # See http://backuppc.sourceforge.net. # diff --git a/bin/BackupPC_zipCreate b/bin/BackupPC_zipCreate index 978c449..2a01965 100755 --- a/bin/BackupPC_zipCreate +++ b/bin/BackupPC_zipCreate @@ -1,4 +1,4 @@ -#!/bin/perl -T +#!/bin/perl #============================================================= -*-perl-*- # # BackupPC_zipCreate: create a zip archive of an existing dump @@ -51,7 +51,7 @@ # #======================================================================== # -# Version 2.1.0_CVS, released 3 Jul 2003. +# Version 2.1.0_CVS, released 8 Feb 2004. # # See http://backuppc.sourceforge.net. # diff --git a/cgi-bin/BackupPC_Admin b/cgi-bin/BackupPC_Admin index 8dc2091..32293df 100755 --- a/cgi-bin/BackupPC_Admin +++ b/cgi-bin/BackupPC_Admin @@ -1,4 +1,4 @@ -#!/bin/perl -T +#!/bin/perl #============================================================= -*-perl-*-w # # BackupPC_Admin: Apache/CGI interface for BackupPC. @@ -39,7 +39,7 @@ # #======================================================================== # -# Version 2.1.0_CVS, released 3 Jul 2003. +# Version 2.1.0_CVS, released 8 Feb 2004. # # See http://backuppc.sourceforge.net. # @@ -90,6 +90,19 @@ $In{action} ||= "hostInfo" if ( defined($In{host}) ); $In{action} = "summary" if ( !defined($ActionDispatch{$In{action}}) && !CheckPermission()); $In{action} = "generalInfo" if ( !defined($ActionDispatch{$In{action}}) ); my $action = $ActionDispatch{$In{action}}; + +# +# For some reason under mod_perl, the use lib above is unreliable, +# and sometimes the module below cannot be found. Explicitly push +# the directory onto INC if it is missing. This is an ugly hack; +# need to figure out what's really going on... +# +my $installDir = '/usr/local/BackupPC/lib'; +push(@INC, $installDir) if ( !grep($_ eq $installDir, @INC) ); + +# +# Load the relevant action script and run it +# require "BackupPC/CGI/$action.pm" if ( !defined($BackupPC::CGI::{"${action}::"}) ); $BackupPC::CGI::{"${action}::"}{action}(); diff --git a/conf/config.pl b/conf/config.pl index 85d385e..5b0cd94 100644 --- a/conf/config.pl +++ b/conf/config.pl @@ -433,9 +433,9 @@ $Conf{IncrFill} = 0; $Conf{RestoreInfoKeepCnt} = 10; # -# Number of archive logs to keep. BackupPC remembers information about -# each archive request. This number per archive client will be kept around before -# the oldest ones are pruned. +# Number of archive logs to keep. BackupPC remembers information +# about each archive request. This number per archive client will +# be kept around before the oldest ones are pruned. # $Conf{ArchiveInfoKeepCnt} = 10; @@ -919,7 +919,7 @@ $Conf{ArchiveSplit} = 650; # Archive Command # # This is the command that is called to actually run the archive process -# The following variables are substituted at run-time: +# for each host. The following variables are substituted at run-time: # # $Installdir The installation directory of BackupPC # $tarCreatePath The path to BackupPC_tarCreate @@ -933,7 +933,9 @@ $Conf{ArchiveSplit} = 650; # $archiveloc The location to put the archive # $parfile The number of par files to create # -$Conf{ArchiveClientCmd} = '$Installdir/bin/BackupPC_archivecd $tarCreatePath $splitpath $parpath $host $backupnumber $compression $compext $splitsize $archiveloc $parfile /'; +$Conf{ArchiveClientCmd} = '$Installdir/bin/BackupPC_archiveHost' + . ' $tarCreatePath $splitpath $parpath $host $backupnumber' + . ' $compression $compext $splitsize $archiveloc $parfile *'; # # Full path for ssh. Security caution: normal users should not @@ -1418,11 +1420,6 @@ $Conf{CgiDateFormatMMDD} = 1; # $Conf{CgiNavBarAdminAllHosts} = 0; -# -# Color scheme for CGI interface. -# -$Conf{CgiHeaderBgColor} = '#99cc33'; - # # Hilight colors based on status that are used in the PC summary page. # @@ -1435,10 +1432,7 @@ $Conf{CgiStatusHilightColor} = { }; # -# Additional CGI header text. For example, if you wanted each CGI page -# to auto refresh every 900 seconds, you could add this text: -# -# +# Additional CGI header text. # $Conf{CgiHeaders} = ''; @@ -1505,7 +1499,6 @@ p { a { font-family:arial,sans-serif; - font-size:1em; color:#3333ff } @@ -1534,7 +1527,8 @@ a.navbar { font-weight:bold; background-color:#99cc33; padding:3px; - padding-left:10px + padding-left:6px; + margin-bottom:5px; } .h2 { @@ -1544,26 +1538,29 @@ a.navbar { font-weight:bold; background-color:#ddeeee; padding:3px; - padding-left:10px + padding-left:6px; + margin-top:3px; + margin-bottom:1px; } -.border { - border-bottom:1px solid #000000; - border-left:1px dotted #666666; - font-size:.9em; +.tableStnd { } .tableheader { font-size:.8em; font-weight:bold; - background-color:#cccccc + background-color:#cccccc; +} + +.border { + font-size:.9em; } .fviewheader { font-weight:bold; font-size:.8em; color:#ffffff; - background-color:#999999 + background-color:#999999; } .fviewborder { @@ -1585,7 +1582,7 @@ a.navbar { font-size:.8em; font-family:arial,sans-serif; text-decoration:none; - line-height:15px + line-height:15px; } .fviewbold { @@ -1605,7 +1602,7 @@ a.navbar { .histViewMis { border-bottom:1px solid #000000; - background-color:#ffdddd + background-color:#ffdddd; } div.NavMenu { @@ -1627,6 +1624,7 @@ div.NavTitle { font-family:arial,sans-serif; color:#000000; font-weight:bold; + margin-bottom:2px; } #Content { diff --git a/configure.pl b/configure.pl index 0ca5862..cfba6cc 100755 --- a/configure.pl +++ b/configure.pl @@ -411,7 +411,7 @@ printf("Installing binaries in $Conf{InstallDir}/bin\n"); foreach my $prog ( qw(BackupPC BackupPC_dump BackupPC_link BackupPC_nightly BackupPC_sendEmail BackupPC_tarCreate BackupPC_trashClean BackupPC_tarExtract BackupPC_compressPool BackupPC_zcat - BackupPC_archive BackupPC_archivecd BackupPC_archivetape + BackupPC_archive BackupPC_archiveHost BackupPC_restore BackupPC_serverMesg BackupPC_zipCreate ) ) { InstallFile("bin/$prog", "$Conf{InstallDir}/bin/$prog", 0555); } @@ -691,7 +691,7 @@ sub InstallFile s/__CGIDIR__/$Conf{CgiDir}/g; if ( $first && /^#.*bin\/perl/ ) { # - # Fill in correct path to perl (no taint for >= 2.1.0). + # Fill in correct path to perl (no taint for >= 2.0.1). # print OUT "#!$Conf{PerlPath}\n"; } else { diff --git a/lib/BackupPC/Attrib.pm b/lib/BackupPC/Attrib.pm index 612d4c5..12f3c33 100644 --- a/lib/BackupPC/Attrib.pm +++ b/lib/BackupPC/Attrib.pm @@ -30,7 +30,7 @@ # #======================================================================== # -# Version 2.1.0_CVS, released 3 Jul 2003. +# Version 2.1.0_CVS, released 8 Feb 2004. # # See http://backuppc.sourceforge.net. # diff --git a/lib/BackupPC/CGI/AdminOptions.pm b/lib/BackupPC/CGI/AdminOptions.pm index d9e58b3..1bd5b29 100644 --- a/lib/BackupPC/CGI/AdminOptions.pm +++ b/lib/BackupPC/CGI/AdminOptions.pm @@ -28,7 +28,7 @@ # #======================================================================== # -# Version 2.1.0_CVS, released 3 Jul 2003. +# Version 2.1.0_CVS, released 8 Feb 2004. # # See http://backuppc.sourceforge.net. # diff --git a/lib/BackupPC/CGI/Archive.pm b/lib/BackupPC/CGI/Archive.pm index 2a774eb..205111a 100644 --- a/lib/BackupPC/CGI/Archive.pm +++ b/lib/BackupPC/CGI/Archive.pm @@ -28,7 +28,7 @@ # #======================================================================== # -# Version 2.1.0_CVS, released 3 Jul 2003. +# Version 2.1.0_CVS, released 8 Feb 2004. # # See http://backuppc.sourceforge.net. # @@ -42,10 +42,12 @@ use Data::Dumper; sub action { + my $archHost = $In{host}; + if ( $In{type} == 0 ) { my($fullTot, $fullSizeTot, $incrTot, $incrSizeTot, $str, - $strNone, $strGood, $hostCntGood, $hostCntNone, $checkBoxCnt, - $backupnumber); + $strNone, $strGood, $hostCntGood, $hostCntNone, $checkBoxCnt, + $backupnumber); $hostCntGood = $hostCntNone = $checkBoxCnt = $fullSizeTot = 0; GetStatusInfo("hosts"); @@ -91,12 +93,11 @@ EOF EOF my $content = eval("qq{$Lang->{BackupPC_Archive}}"); - Header(eval("qq{$Lang->{BackupPC__Archive}}"),$content); + Header(eval("qq{$Lang->{BackupPC__Archive}}"), $content, 1); Trailer(); } else { - - my(@HostList, @BackupList, $HostListStr, $hiddenStr, $pathHdr, $badFileCnt, $reply, $str); - + my(@HostList, @BackupList, $HostListStr, $hiddenStr, $pathHdr, + $badFileCnt, $reply, $str); my $Privileged = CheckPermission(); my $args = { SplitPath => $bpc->{Conf}{SplitPath}, @@ -137,8 +138,9 @@ EOF if ( @HostList == 0 ) { ErrorExit($Lang->{You_haven_t_selected_any_hosts}); } - my ($ArchiveDest, $ArchiveCompNone, $ArchiveCompGzip, $ArchiveCompBzip2, $ArchivePar, $ArchiveSplit); - $ArchiveDest = $bpc->{Conf}{ArchiveDest}; + my ($ArchiveDest, $ArchiveCompNone, $ArchiveCompGzip, + $ArchiveCompBzip2, $ArchivePar, $ArchiveSplit); + $ArchiveDest = $bpc->{Conf}{ArchiveDest}; if ( $bpc->{Conf}{ArchiveComp} eq "none" ) { $ArchiveCompNone = "checked"; } else { @@ -154,16 +156,30 @@ EOF } else { $ArchiveCompBzip2 = ""; } - $ArchivePar = $bpc->{Conf}{ArchivePar}; - $ArchiveSplit = $bpc->{Conf}{ArchiveSplit}; + $ArchivePar = $bpc->{Conf}{ArchivePar}; + $ArchiveSplit = $bpc->{Conf}{ArchiveSplit}; if ( $In{type} == 1 ) { # # Tell the user what options they have # - + my $paramStr = ""; + if ( $bpc->{Conf}{ArchiveClientCmd} =~ /\$archiveloc\b/ ) { + $paramStr .= eval("qq{$Lang->{BackupPC_Archive2_location}}"); + } + if ( $bpc->{Conf}{ArchiveClientCmd} =~ /\$compression\b/ ) { + $paramStr .= eval("qq{$Lang->{BackupPC_Archive2_compression}}"); + } + if ( $bpc->{Conf}{ArchiveClientCmd} =~ /\$parfile\b/ + && -x $bpc->{Conf}{ParPath} ) { + $paramStr .= eval("qq{$Lang->{BackupPC_Archive2_parity}}"); + } + if ( $bpc->{Conf}{ArchiveClientCmd} =~ /\$splitsize\b/ + && -x $bpc->{Conf}{SplitPath} ) { + $paramStr .= eval("qq{$Lang->{BackupPC_Archive2_split}}"); + } my $content = eval("qq{$Lang->{BackupPC_Archive2}}"); - Header(eval("qq{$Lang->{BackupPC__Archive}}"),$content); + Header(eval("qq{$Lang->{BackupPC__Archive}}"), $content, 1); Trailer(); } elsif ( $In{type} == 2 ) { my $reqFileName; @@ -172,20 +188,15 @@ EOF $reqFileName = "archiveReq.$$.$i"; last if ( !-f "$TopDir/pc/$archivehost/$reqFileName" ); } - my $compname; - if ( $In{compression} == 2 ) { # bzip2 compression + my($compname, $compext); + if ( $In{compression} == 2 ) { # bzip2 compression $compname = $Conf{Bzip2Path}; - } elsif ( $In{compression} == 1 ) { # gzip compression - $compname = $Conf{GzipPath}; - } else { # No Compression - $compname = $Conf{CatPath}; - } - my $compext; - if ( $In{compression} == 2 ) { # bzip2 compression $compext = '.bz2'; - } elsif ( $In{compression} == 1 ) { # gzip compression + } elsif ( $In{compression} == 1 ) { # gzip compression + $compname = $Conf{GzipPath}; $compext = '.gz'; } else { # No Compression + $compname = $Conf{CatPath}; $compext = '.raw'; } my $fullsplitsize = $In{splitsize} . '000000'; @@ -199,7 +210,6 @@ EOF splitsize => $fullsplitsize, host => $archivehost, - # list of hosts to restore HostList => \@HostList, BackupList => \@BackupList, @@ -219,17 +229,14 @@ EOF } else { ErrorExit($Lang->{Can_t_open_create} ); } - $reply = $bpc->ServerMesg("archive $User $archivehost $reqFileName"); - - $str = eval("qq{$Lang->{Archive_requested}}"); + $reply = $bpc->ServerMesg("archive $User $archivehost $reqFileName"); + $str = eval("qq{$Lang->{Archive_requested}}"); my $content = eval("qq{$Lang->{BackupPC_Archive_Reply_from_server}}"); - Header(eval("qq{$Lang->{BackupPC__Archive}}"),$content); + Header(eval("qq{$Lang->{BackupPC__Archive}}"), $content, 1); Trailer(); } - } - } 1; diff --git a/lib/BackupPC/CGI/ArchiveInfo.pm b/lib/BackupPC/CGI/ArchiveInfo.pm index 962aa0c..61660c6 100644 --- a/lib/BackupPC/CGI/ArchiveInfo.pm +++ b/lib/BackupPC/CGI/ArchiveInfo.pm @@ -28,7 +28,7 @@ # #======================================================================== # -# Version 2.1.0_CVS, released 3 Jul 2003. +# Version 2.1.0_CVS, released 8 Feb 2004. # # See http://backuppc.sourceforge.net. # diff --git a/lib/BackupPC/CGI/Browse.pm b/lib/BackupPC/CGI/Browse.pm index 70dd4a1..0957a72 100644 --- a/lib/BackupPC/CGI/Browse.pm +++ b/lib/BackupPC/CGI/Browse.pm @@ -28,7 +28,7 @@ # #======================================================================== # -# Version 2.1.0_CVS, released 3 Jul 2003. +# Version 2.1.0_CVS, released 8 Feb 2004. # # See http://backuppc.sourceforge.net. # diff --git a/lib/BackupPC/CGI/DirHistory.pm b/lib/BackupPC/CGI/DirHistory.pm index f19bf94..fc98d57 100644 --- a/lib/BackupPC/CGI/DirHistory.pm +++ b/lib/BackupPC/CGI/DirHistory.pm @@ -28,7 +28,7 @@ # #======================================================================== # -# Version 2.1.0_CVS, released 3 Jul 2003. +# Version 2.1.0_CVS, released 8 Feb 2004. # # See http://backuppc.sourceforge.net. # diff --git a/lib/BackupPC/CGI/EmailSummary.pm b/lib/BackupPC/CGI/EmailSummary.pm index 68bd498..d89dcbe 100644 --- a/lib/BackupPC/CGI/EmailSummary.pm +++ b/lib/BackupPC/CGI/EmailSummary.pm @@ -28,7 +28,7 @@ # #======================================================================== # -# Version 2.1.0_CVS, released 3 Jul 2003. +# Version 2.1.0_CVS, released 8 Feb 2004. # # See http://backuppc.sourceforge.net. # diff --git a/lib/BackupPC/CGI/GeneralInfo.pm b/lib/BackupPC/CGI/GeneralInfo.pm index 1418ace..cbf3bb8 100644 --- a/lib/BackupPC/CGI/GeneralInfo.pm +++ b/lib/BackupPC/CGI/GeneralInfo.pm @@ -28,7 +28,7 @@ # #======================================================================== # -# Version 2.1.0_CVS, released 3 Jul 2003. +# Version 2.1.0_CVS, released 8 Feb 2004. # # See http://backuppc.sourceforge.net. # diff --git a/lib/BackupPC/CGI/HostInfo.pm b/lib/BackupPC/CGI/HostInfo.pm index a49eb79..cf58ad7 100644 --- a/lib/BackupPC/CGI/HostInfo.pm +++ b/lib/BackupPC/CGI/HostInfo.pm @@ -28,7 +28,7 @@ # #======================================================================== # -# Version 2.1.0_CVS, released 3 Jul 2003. +# Version 2.1.0_CVS, released 8 Feb 2004. # # See http://backuppc.sourceforge.net. # @@ -76,7 +76,7 @@ sub action } ReadUserEmailInfo(); - if ($Conf{XferMethod} eq "archive" ) { + if ( $Conf{XferMethod} eq "archive" ) { my @Archives = $bpc->ArchiveInfoRead($host); my ($ArchiveStr,$warnStr); @@ -112,7 +112,7 @@ EOF } my $content = eval("qq{$Lang->{Host__host_Archive_Summary2}}"); - Header(eval("qq{$Lang->{Host__host_Archive_Summary}}"), $content); + Header(eval("qq{$Lang->{Host__host_Archive_Summary}}"), $content, 1); Trailer(); return; } diff --git a/lib/BackupPC/CGI/LOGlist.pm b/lib/BackupPC/CGI/LOGlist.pm index 71b7d81..59f940b 100644 --- a/lib/BackupPC/CGI/LOGlist.pm +++ b/lib/BackupPC/CGI/LOGlist.pm @@ -28,7 +28,7 @@ # #======================================================================== # -# Version 2.1.0_CVS, released 3 Jul 2003. +# Version 2.1.0_CVS, released 8 Feb 2004. # # See http://backuppc.sourceforge.net. # @@ -75,7 +75,8 @@ sub action EOF } my $content = eval("qq{$Lang->{Log_File_History__hdr}}"); - Header($Lang->{BackupPC__Log_File_History}, $content); + Header($Lang->{BackupPC__Log_File_History}, + $content, !-f "$TopDir/pc/$host/backups"); Trailer(); } diff --git a/lib/BackupPC/CGI/Lib.pm b/lib/BackupPC/CGI/Lib.pm index 4bc7227..6a9ad1b 100644 --- a/lib/BackupPC/CGI/Lib.pm +++ b/lib/BackupPC/CGI/Lib.pm @@ -29,7 +29,7 @@ # #======================================================================== # -# Version 2.1.0_CVS, released 3 Jul 2003. +# Version 2.1.0_CVS, released 8 Feb 2004. # # See http://backuppc.sourceforge.net. # @@ -387,7 +387,7 @@ sub ConfirmIPAddress sub Header { - my($title, $content) = @_; + my($title, $content, $noBrowse) = @_; my @adminLinks = ( { link => "", name => $Lang->{Status}, priv => 1}, @@ -430,7 +430,7 @@ EOF NavLink("?host=${EscURI($host)}", "$host $Lang->{Home}", " class=\"navbar\""); NavLink("?action=browse&host=${EscURI($host)}", - $Lang->{Browse}, " class=\"navbar\""); + $Lang->{Browse}, " class=\"navbar\"") if ( !$noBrowse ); NavLink("?action=view&type=LOG&host=${EscURI($host)}", $Lang->{LOG_file}, " class=\"navbar\""); NavLink("?action=LOGlist&host=${EscURI($host)}", diff --git a/lib/BackupPC/CGI/Queue.pm b/lib/BackupPC/CGI/Queue.pm index 82eeed4..d2bf4b6 100644 --- a/lib/BackupPC/CGI/Queue.pm +++ b/lib/BackupPC/CGI/Queue.pm @@ -28,7 +28,7 @@ # #======================================================================== # -# Version 2.1.0_CVS, released 3 Jul 2003. +# Version 2.1.0_CVS, released 8 Feb 2004. # # See http://backuppc.sourceforge.net. # diff --git a/lib/BackupPC/CGI/ReloadServer.pm b/lib/BackupPC/CGI/ReloadServer.pm index 13b66b2..29ed790 100644 --- a/lib/BackupPC/CGI/ReloadServer.pm +++ b/lib/BackupPC/CGI/ReloadServer.pm @@ -28,7 +28,7 @@ # #======================================================================== # -# Version 2.1.0_CVS, released 3 Jul 2003. +# Version 2.1.0_CVS, released 8 Feb 2004. # # See http://backuppc.sourceforge.net. # @@ -41,10 +41,9 @@ use BackupPC::CGI::Lib qw(:all); sub action { - if ( defined($bpc) ) { - $bpc->ServerMesg("log User $User requested server configuration reload"); - $bpc->ServerMesg("server reload"); - } + ServerConnect(); + $bpc->ServerMesg("log User $User requested server configuration reload"); + $bpc->ServerMesg("server reload"); print $Cgi->redirect($MyURL); } diff --git a/lib/BackupPC/CGI/Restore.pm b/lib/BackupPC/CGI/Restore.pm index 29cfcf8..12d6020 100644 --- a/lib/BackupPC/CGI/Restore.pm +++ b/lib/BackupPC/CGI/Restore.pm @@ -28,7 +28,7 @@ # #======================================================================== # -# Version 2.1.0_CVS, released 3 Jul 2003. +# Version 2.1.0_CVS, released 8 Feb 2004. # # See http://backuppc.sourceforge.net. # @@ -39,6 +39,7 @@ package BackupPC::CGI::Restore; use strict; use BackupPC::CGI::Lib qw(:all); use Data::Dumper; +use File::Path; sub action { @@ -102,9 +103,11 @@ EOF # Build list of hosts # my $hostDestSel; + my @hosts; foreach my $h ( GetUserHosts() ) { my $sel = " selected" if ( $h eq $In{host} ); $hostDestSel .= ""; + push(@hosts, $h); } # @@ -112,6 +115,36 @@ EOF # $content .= eval("qq{$Lang->{Restore_Options_for__host2}}"); + # + # If there is a single host, make sure direct restore is enabled + # + 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) ) { + $content .= eval( + "qq{$Lang->{Restore_Options_for__host_Option1}}"); + } else { + my $hostDest = $hosts[0]; + $content .= eval( + "qq{$Lang->{Restore_Options_for__host_Option1_disabled}}"); + } + } else { + $content .= eval("qq{$Lang->{Restore_Options_for__host_Option1}}"); + } + # # Verify that Archive::Zip is available before showing the # zip restore option @@ -208,6 +241,25 @@ EOF if ( !CheckPermission($In{hostDest}) ) { ErrorExit(eval("qq{$Lang->{You_don_t_have_permission_to_restore_onto_host}}")); } + # + # Pick up the destination host's config file + # + my $hostDest = $1 if ( $In{hostDest} =~ /(.*)/ ); + $bpc->ConfigRead($hostDest); + %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) ) { + ErrorExit(eval("qq{$Lang->{Restore_Options_for__host_Option1_disabled}}")); + } + $fileListStr = ""; foreach my $f ( @fileList ) { my $targetFile = $f; @@ -264,6 +316,8 @@ EOF [ \%restoreReq], [qw(*RestoreReq)]); $dump->Indent(1); + mkpath("$TopDir/pc/$hostDest", 0, 0777) + if ( !-d "$TopDir/pc/$hostDest" ); if ( open(REQ, ">$TopDir/pc/$hostDest/$reqFileName") ) { binmode(REQ); print(REQ $dump->Dump); diff --git a/lib/BackupPC/CGI/RestoreFile.pm b/lib/BackupPC/CGI/RestoreFile.pm index fa732b6..9a295bb 100644 --- a/lib/BackupPC/CGI/RestoreFile.pm +++ b/lib/BackupPC/CGI/RestoreFile.pm @@ -28,7 +28,7 @@ # #======================================================================== # -# Version 2.1.0_CVS, released 3 Jul 2003. +# Version 2.1.0_CVS, released 8 Feb 2004. # # See http://backuppc.sourceforge.net. # diff --git a/lib/BackupPC/CGI/RestoreInfo.pm b/lib/BackupPC/CGI/RestoreInfo.pm index b018bf5..93dacb6 100644 --- a/lib/BackupPC/CGI/RestoreInfo.pm +++ b/lib/BackupPC/CGI/RestoreInfo.pm @@ -28,7 +28,7 @@ # #======================================================================== # -# Version 2.1.0_CVS, released 3 Jul 2003. +# Version 2.1.0_CVS, released 8 Feb 2004. # # See http://backuppc.sourceforge.net. # diff --git a/lib/BackupPC/CGI/StartServer.pm b/lib/BackupPC/CGI/StartServer.pm index d0cb973..cdf130c 100644 --- a/lib/BackupPC/CGI/StartServer.pm +++ b/lib/BackupPC/CGI/StartServer.pm @@ -28,7 +28,7 @@ # #======================================================================== # -# Version 2.1.0_CVS, released 3 Jul 2003. +# Version 2.1.0_CVS, released 8 Feb 2004. # # See http://backuppc.sourceforge.net. # diff --git a/lib/BackupPC/CGI/StartStopBackup.pm b/lib/BackupPC/CGI/StartStopBackup.pm index 578e553..199deb8 100644 --- a/lib/BackupPC/CGI/StartStopBackup.pm +++ b/lib/BackupPC/CGI/StartStopBackup.pm @@ -28,7 +28,7 @@ # #======================================================================== # -# Version 2.1.0_CVS, released 3 Jul 2003. +# Version 2.1.0_CVS, released 8 Feb 2004. # # See http://backuppc.sourceforge.net. # @@ -87,7 +87,8 @@ sub action ($StatusHost{backoffTime} - time) / 3600); } my $content = eval ("qq{$Lang->{Are_you_sure_stop}}"); - Header($Lang->{BackupPC__Stop_Backup_Confirm_on__host},$content); + Header(eval("qq{$Lang->{BackupPC__Stop_Backup_Confirm_on__host}}"), + $content); } Trailer(); } diff --git a/lib/BackupPC/CGI/StopServer.pm b/lib/BackupPC/CGI/StopServer.pm index f73f4b8..4851313 100644 --- a/lib/BackupPC/CGI/StopServer.pm +++ b/lib/BackupPC/CGI/StopServer.pm @@ -28,7 +28,7 @@ # #======================================================================== # -# Version 2.1.0_CVS, released 3 Jul 2003. +# Version 2.1.0_CVS, released 8 Feb 2004. # # See http://backuppc.sourceforge.net. # diff --git a/lib/BackupPC/CGI/Summary.pm b/lib/BackupPC/CGI/Summary.pm index 4d70694..c610e70 100644 --- a/lib/BackupPC/CGI/Summary.pm +++ b/lib/BackupPC/CGI/Summary.pm @@ -28,7 +28,7 @@ # #======================================================================== # -# Version 2.1.0_CVS, released 3 Jul 2003. +# Version 2.1.0_CVS, released 8 Feb 2004. # # See http://backuppc.sourceforge.net. # diff --git a/lib/BackupPC/CGI/View.pm b/lib/BackupPC/CGI/View.pm index 4f3070a..d60196b 100644 --- a/lib/BackupPC/CGI/View.pm +++ b/lib/BackupPC/CGI/View.pm @@ -28,7 +28,7 @@ # #======================================================================== # -# Version 2.1.0_CVS, released 3 Jul 2003. +# Version 2.1.0_CVS, released 8 Feb 2004. # # See http://backuppc.sourceforge.net. # @@ -121,7 +121,8 @@ sub action $content .= "
";
         if ( $type eq "XferErr" || $type eq "XferErrbad"
-				|| $type eq "RestoreErr" ) {
+				|| $type eq "RestoreErr"
+				|| $type eq "ArchiveErr" ) {
 	    my $skipped;
             while ( 1 ) {
                 $_ = $fh->readLine();
@@ -133,17 +134,18 @@ sub action
                 if ( /smb: \\>/
                         || /^\s*(\d+) \(\s*\d+\.\d kb\/s\) (.*)$/
                         || /^tar: dumped \d+ files/
-                        || /^added interface/i
-                        || /^restore tar file /i
-                        || /^restore directory /i
-                        || /^tarmode is now/i
-                        || /^Total bytes written/i
-                        || /^Domain=/i
-                        || /^Getting files newer than/i
-                        || /^Output is \/dev\/null/
-                        || /^\([\d\.]* kb\/s\) \(average [\d\.]* kb\/s\)$/
+                        || /^\s*added interface/i
+                        || /^\s*restore tar file /i
+                        || /^\s*restore directory /i
+                        || /^\s*tarmode is now/i
+                        || /^\s*Total bytes written/i
+                        || /^\s*Domain=/i
+                        || /^\s*Getting files newer than/i
+                        || /^\s*Output is \/dev\/null/
+                        || /^\s*\([\d.,]* kb\/s\) \(average [\d\.]* kb\/s\)$/
                         || /^\s+directory \\/
-                        || /^Timezone is/
+                        || /^\s*Timezone is/
+			|| /^\s*creating lame (up|low)case table/i
                         || /^\.\//
                         || /^  /
 			    ) {
@@ -189,7 +191,8 @@ sub action
     $content .= <
 EOF
-    Header(eval("qq{$Lang->{Backup_PC__Log_File__file}}"), $content);
+    Header(eval("qq{$Lang->{Backup_PC__Log_File__file}}"),
+                    $content, !-f "$TopDir/pc/$host/backups" );
     Trailer();
 }
 
diff --git a/lib/BackupPC/FileZIO.pm b/lib/BackupPC/FileZIO.pm
index 4bae50a..95237a5 100644
--- a/lib/BackupPC/FileZIO.pm
+++ b/lib/BackupPC/FileZIO.pm
@@ -29,7 +29,7 @@
 #
 #========================================================================
 #
-# Version 2.1.0_CVS, released 3 Jul 2003.
+# Version 2.1.0_CVS, released 8 Feb 2004.
 #
 # See http://backuppc.sourceforge.net.
 #
@@ -102,7 +102,7 @@ sub open
 	binmode(FH);
         $fh = *FH;
     }
-    $compLevel = 0 if ( !$CompZlibOK );
+    $compLevel  = 0 if ( !$CompZlibOK );
     my $self = bless {
         fh           => $fh,
         name         => $fileName,
@@ -115,6 +115,7 @@ sub open
             $self->{deflate} = $self->myDeflateInit;
         } else {
             $self->{inflate} = $self->myInflateInit;
+            $self->{inflateStart} = 1;
         }
     }
     return $self;
@@ -157,11 +158,42 @@ sub read
             return $n if ( $n < 0 );
             $self->{eof} = 1 if ( $n == 0 );
         }
+        if ( $self->{inflateStart} && $self->{dataIn} ne "" ) {
+            my $chr = substr($self->{dataIn}, 0, 1);
+
+            $self->{inflateStart} = 0;
+            if ( $chr eq chr(0xd6) ) {
+                #
+                # Flag 0xd6 means this is a compressed file with
+                # appended md4 block checksums for rsync.  Change
+                # the first byte back to 0x78 and proceed.
+                #
+                ##print("Got 0xd6 block: normal\n");
+                substr($self->{dataIn}, 0, 1) = chr(0x78);
+            } elsif ( $chr eq chr(0xb3) ) {
+                #
+                # Flag 0xb3 means this is the start of the rsync
+                # block checksums, so consider this as EOF for
+                # the compressed file.  Also seek the file so
+                # it is positioned at the 0xb3.
+                #
+                seek($self->{fh}, -length($self->{dataIn}), 1);
+                $self->{eof} = 1;
+                $self->{dataIn} = "";
+                ##print("Got 0xb3 block: considering eof\n");
+                last;
+            } else {
+                #
+                # normal case: nothing to do
+                #
+            }
+        }
         my($data, $err) = $self->{inflate}->inflate($self->{dataIn});
         $self->{dataOut} .= $data;
         if ( $err == Z_STREAM_END ) {
             #print("R");
             $self->{inflate} = $self->myInflateInit;
+            $self->{inflateStart} = 1;
         } elsif ( $err != Z_OK ) {
             $$dataRef = "";
             return -1;
@@ -215,6 +247,7 @@ sub rewind
     $self->{dataIn}  = '';
     $self->{eof}     = 0;
     $self->{inflate} = $self->myInflateInit;
+    $self->{inflateStart} = 1;
     return sysseek($self->{fh}, 0, 0);
 }
 
@@ -247,7 +280,7 @@ sub write
     my $n = length($$dataRef);
 
     return if ( !$self->{write} );
-    print($$dataRef) if ( $self->{writeTeeStdout} );
+    print(STDERR $$dataRef) if ( $self->{writeTeeStderr} );
     return 0 if ( $n == 0 );
     if ( !$self->{compress} ) {
         #
@@ -305,12 +338,12 @@ sub name
     return $self->{name};
 }
 
-sub writeTeeStdout
+sub writeTeeStderr
 {
     my($self, $param) = @_;
 
-    $self->{writeTeeStdout} = $param if ( defined($param) );
-    return $self->{writeTeeStdout};
+    $self->{writeTeeStderr} = $param if ( defined($param) );
+    return $self->{writeTeeStderr};
 }
 
 sub close
diff --git a/lib/BackupPC/Lang/de.pm b/lib/BackupPC/Lang/de.pm
index 5ae2a03..3ef23b6 100644
--- a/lib/BackupPC/Lang/de.pm
+++ b/lib/BackupPC/Lang/de.pm
@@ -1,4 +1,4 @@
-#!/bin/perl -T
+#!/bin/perl
 #
 # by Manfred Herrmann (V1.1) (some typo errors + 3 new strings)
 # CVS-> Revision ???
@@ -9,11 +9,55 @@
 
 # --------------------------------
 
+$Lang{Start_Archive} = "ENG Start Archive";
+$Lang{Stop_Dequeue_Archive} = "ENG Stop/Dequeue Archive";
 $Lang{Start_Full_Backup} = "Starte Backup vollständig";
 $Lang{Start_Incr_Backup} = "Starte Backup incrementell";
 $Lang{Stop_Dequeue_Backup} = "Stoppen/Aussetzen Backup";
 $Lang{Restore} = "Wiederherstellung";
 
+$Lang{Type_full} = "ENG full";
+$Lang{Type_incr} = "ENG incremental";
+
+# -----
+
+$Lang{Only_privileged_users_can_view_admin_options} = "ENG Only privileged users can view admin options.";
+$Lang{H_Admin_Options} = "ENG BackupPC Server: Admin Options";
+$Lang{Admin_Options} = "ENG Admin Options";
+$Lang{Admin_Options_Page} = <
+\${h1("Server Control")}
+
+ +
Stop the server: +
Reload the server configuration: +
+
+\${h1("Server Configuration")} +
    +
  • Other options can go here... e.g., +
  • Edit server configuration +
+EOF +$Lang{Unable_to_connect_to_BackupPC_server} = "Kann keine Verbindung zu BackupPC server herstellen", + "Dieses CGI script (\$MyURL) kann keine Verbindung zu BackupPC" + . " server auf \$Conf{ServerHost} port \$Conf{ServerPort} herstellen. Der Fehler" + . " war: \$err.", + "Möglicherweise ist der BackupPC server Prozess nicht gestartet oder es besteht ein" + . " Konfigurationsfehler. Bitte teilen Sie diese Fehlermeldung dem Systemadministrator mit."; +$Lang{Admin_Start_Server} = < +The BackupPC server at \$Conf{ServerHost} port \$Conf{ServerPort} +is not currently running (maybe you just stopped it, or haven't yet started it).
+Do you want to start it? + + + +EOF + # ----- $Lang{H_BackupPC_Server_Status} = "BackupServer Server Status"; @@ -28,6 +72,7 @@ $Lang{BackupPC_Server_Status}= < Die Server Prozess ID (PID) ist \$Info{pid}, auf Computer \$Conf{ServerHost}, Version \$Info{Version}, gestartet am \$serverStartTime.
  • Dieser Status wurde am \$now generiert. +
  • ENG The configuration was last loaded at \$configLoadTime.
  • Computer werden am \$nextWakeupTime auf neue Aufträge geprüft.
  • Weitere Informationen:
      @@ -44,8 +89,8 @@ $Lang{BackupPC_Server_Status}= < - - +
      Computer
      + @@ -59,8 +104,8 @@ $Lang{BackupPC_Server_Status}= < -
      Computer Typ User Startzeit
      - +
      Computer
      + @@ -73,12 +118,13 @@ EOF # -------------------------------- $Lang{BackupPC__Server_Summary} = "BackupServer: Übersicht"; +$Lang{BackupPC__Archive} = "ENG BackupPC: Archive"; $Lang{BackupPC_Summary}=< Dieser Status wurde generiert am \$now. -

      +

      \${h2("Computer mit erfolgreichen Backups")}

      @@ -89,8 +135,9 @@ Es gibt \$hostCntGood Computer die erfolgreich gesichert wurden, mit insgesamt:

    • \$incrTot Incrementelle Backups, Gesamtgröße \${incrSizeTot}GB (vor pooling und Komprimierung). -
    • Computer Typ User letzter Versuch
      - +

      +
      Computer
      + @@ -102,14 +149,13 @@ Es gibt \$hostCntGood Computer die erfolgreich gesichert wurden, mit insgesamt: \$strGood
      Computer User #Voll Alter/Tage Letzte Aktion
      -

      - +

      \${h2("Computer ohne Backups")}

      Es gibt \$hostCntNone Computer ohne Backups !!!.

      - - +
      Computer
      + @@ -123,6 +169,107 @@ Es gibt \$hostCntNone Computer ohne Backups !!!.
      Computer User #Voll Alter/Tage
      EOF +$Lang{BackupPC_Archive} = < + + + +There are \$hostCntGood hosts that have been backed up for a total size of \${fullSizeTot}GB +

      +

      + + + + + + + + +\$strGood +\$checkAllHosts +
      Host User Backup Size
      +
      +

      + +EOF + +$Lang{BackupPC_Archive2} = < +\$HostListStr +

    +
    +\$hiddenStr + + + + + +\$paramStr + + + + +
    +EOF + +$Lang{BackupPC_Archive2_location} = < + Archive Location/Device + + +EOF + +$Lang{BackupPC_Archive2_compression} = < + Compression + + None
    + gzip
    + bzip2 + + +EOF + +$Lang{BackupPC_Archive2_parity} = < + Number of Parity Files + + +EOF + +$Lang{BackupPC_Archive2_split} = < + Split output into + Megabytes + +EOF + # ----------------------------------- $Lang{Pool_Stat} = <Der Pool hat eine Größe von \${poolSize}GB und enthält \$info->{"\${name}FileCnt"} Dateien und \$info->{"\${name}DirCnt"} Verzeichnisse (Stand \$poolTime). @@ -184,38 +331,42 @@ EOF # -------------------------------- $Lang{Only_privileged_users_can_view_queues_} = "Nur berechtigte User können die Warteschlangen einsehen."; # -------------------------------- +$Lang{Only_privileged_users_can_archive} = "ENG Only privileged users can Archive."; +# -------------------------------- $Lang{BackupPC__Queue_Summary} = "BackupServer: Warteschlangen Übersicht"; # -------------------------------- $Lang{Backup_Queue_Summary} = < +

    \${h2("User Warteschlange Übersicht")}

    Die folgenden User Aufträge sind eingereiht: - - +

    +
    Computer
    + \$strUser
    Computer Uhrzeit User
    -

    +

    \${h2("Hintergrund Warteschlange Übersicht")}

    Die folgenden Hintergrund Aufträge sind eingereiht: - - +

    +
    Computer
    + \$strBg
    Computer Uhrzeit User
    -

    - +

    \${h2("Kommando Warteschlange Übersicht")}

    Die folgenden Kommando Aufträge sind eingereiht: - - +

    +
    Computer
    + @@ -244,8 +395,8 @@ $Lang{BackupPC__Log_File_History} = "BackupServer: LOG Datei Historie"; $Lang{Log_File_History__hdr} = < -
    Computer Uhrzeit User Kommando
    - +
    Datei
    + \$str @@ -256,8 +407,8 @@ EOF $Lang{Recent_Email_Summary} = < -
    Datei Größe letzte Änderung
    - +
    Empfänger
    + @@ -272,26 +423,30 @@ $Lang{Browse_backup__num_for__host} = "BackupServer: Browsen des Backups \$num f # ------------------------------ $Lang{Restore_Options_for__host} = "BackupServer: Restore Optionen für \$host"; $Lang{Restore_Options_for__host2} = < Sie haben die folgenden Dateien/Verzeichnisse von Freigabe \$share selektiert, von Backup Nummer #\$num:
      \$fileListStr
    -

    +

    Sie haben drei verschiedene Möglichkeiten zur Wiederherstellung (Restore) der Dateien/Verzeichnisse. Bitte wählen Sie eine der folgenden Möglichkeiten:. -

    +

    \${h2("Möglichkeit 1: Direct Restore")}

    +EOF + +$Lang{Restore_Options_for__host_Option1} = < -Warnung: alle aktuell existierenden Dateien/Verzeichnisse die bereits vorhanden sind +

    +Warnung: alle aktuell existierenden Dateien/Verzeichnisse die bereits vorhanden sind werden überschrieben! (Tip: alternativ eine spezielle Freigabe erstellen mit schreibrecht für den Backup-User und die wiederhergestellten Dateien/Verzeichnisse durch Stichproben prüfen, ob die beabsichtigte Wiederherstellung korrekt ist) - -
    +

    + @@ -300,8 +455,17 @@ Wiederherstellung korrekt ist)
    Empfänger Computer Zeitpunkt Titel
    - +
    Restore auf Computer + + + Search for available shares (NOT IMPLEMENTED)
    Restore auf Freigabe EOF +$Lang{Restore_Options_for__host_Option1_disabled} = < \${h2("Möglichkeit 2: Download als Zip Archiv Datei")}

    Sie können eine ZIP Archiv Datei downloaden, die alle selektierten Dateien/Verzeichnisse enthält. Mit einer lokalen Anwendung (z.B. WinZIP, WinXP-ZIP-Ordner...) können Sie dann beliebige Dateien entpacken. -

    -Warnung: Abhängig von der Anzahl und Größe der selektierten +

    +Warnung: Abhängig von der Anzahl und Größe der selektierten Dateien/Verzeichnisse kann die ZIP Archiv Datei extrem groß bzw. zu groß werden. Der Download kann sehr lange dauern und der Speicherplatz auf Ihrem PC muß ausreichen. Selektieren Sie evtl. die Dateien/Verzeichnisse erneut und lassen sehr große und unnötige Dateien weg. -

    +

    @@ -350,13 +519,14 @@ EOF # ------------------------------ $Lang{Option_2__Download_Zip_archive2} = < \${h2("Möglichkeit 2: Download als Zip Archiv Datei")}

    Archive::Zip is not installed so you will not be able to download a zip archive. Please ask your system adminstrator to install Archive::Zip from www.cpan.org. -

    +

    EOF @@ -367,12 +537,12 @@ $Lang{Option_3__Download_Zip_archive} = < -Warnung: Abhängig von der Anzahl und Größe der selektierten +

    +Warnung: Abhängig von der Anzahl und Größe der selektierten Dateien/Verzeichnisse kann die Tar Archiv Datei extrem groß bzw. zu groß werden. Der Download kann sehr lange dauern und der Speicherplatz auf Ihrem PC muß ausreichen. Selektieren Sie evtl. die Dateien/Verzeichnisse erneut und lassen sehr große und unnötige Dateien weg. -

    +

    @@ -428,6 +598,12 @@ Die Antwort des BackupServers war: \$reply Zurück zur \$hostDest home page. EOF +$Lang{BackupPC_Archive_Reply_from_server} = < +Reply from server was: \$reply +EOF + # ------------------------- $Lang{Host__host_Backup_Summary} = "BackupServer: Computer \$host Backup Übersicht"; @@ -438,7 +614,7 @@ $Lang{Host__host_Backup_Summary2} = < \$statusStr - +

    \${h2("User Aktionen")}

    @@ -447,12 +623,13 @@ $Lang{Host__host_Backup_Summary2} = < - +

    \${h2("Backup Übersicht")}

    Klicken Sie auf die Backup-Nummer um Dateien zu browsen und bei Bedarf wiederherzustellen. - - +

    +
    Backup#
    + @@ -465,11 +642,12 @@ Klicken Sie auf die Backup-Nummer um Dateien zu browsen und bei Bedarf wiederher

    \$restoreStr - +

    +

    \${h2("Xfer Fehler Übersicht - bitte kontrollieren")} -

    -

    Backup# Typ Filled Start Zeitpunkt
    - +

    +
    Backup#
    + @@ -479,20 +657,21 @@ Klicken Sie auf die Backup-Nummer um Dateien zu browsen und bei Bedarf wiederher \$errStr
    Backup# Typ Anzeigen #Xfer Fehler
    -

    +

    \${h2("Datei Größe/Anzahl Wiederverwendungs Übersicht")}

    -"Bestehende Dateien" bedeutet bereits im Pool vorhanden.
    -"Neue Dateien" bedeutet neu zum Pool hinzugefügt.
    +"Bestehende Dateien" bedeutet bereits im Pool vorhanden. +"Neue Dateien" bedeutet neu zum Pool hinzugefügt. Leere Dateien und Datei-Fehler sind nicht in den Summen enthalten. - - +

    +
    + - + @@ -505,17 +684,18 @@ Leere Dateien und Datei-Fehler sind nicht in den Summen enthalten. \$sizeStr
    Gesamt Bestehende Dateien Neue Dateien
    Backup# Typ #Dateien
    -

    +

    \${h2("Kompression Übersicht")}

    Kompressionsergebnisse für bereits im Backup-Pool vorhandene und für neu komprimierte Dateien. - - +

    +
    + - + @@ -527,7 +707,29 @@ Kompressionsergebnisse f \$compStr
    vorhandene Dateien neue Dateien
    Backup#
    Backup# Typ Comp Level Größe/MB
    +

    +EOF + +$Lang{Host__host_Archive_Summary} = "BackupPC: Host \$host Archive Summary"; +$Lang{Host__host_Archive_Summary2} = < +\$warnStr +

      +\$statusStr +
    + +\${h2("User Actions")} +

    +

    + + + + +
    + +\$ArchiveStr + EOF # ------------------------- @@ -580,10 +782,10 @@ $Lang{Backup_browse_for__host} = < Sie browsen das Backup #\$num, erstellt am \$backupTime (vor \$backupAge Tagen), \$filledBackup +
  • ENG Enter directory:
  • Klicken Sie auf ein Verzeichnis um dieses zu durchsuchen,
  • Klicken Sie auf eine Datei um diese per download wiederherzustellen, -
  • (ENGLISH)You can view the backup history of the current directory. -
  • (ENGLISH)Enter directory: +
  • ENG You can view the backup history of the current directory. @@ -595,18 +797,15 @@ $Lang{Backup_browse_for__host} = <
    - +
    -
    \$dirStr
    -
    - + + +EOF + +$Lang{BackupPC_Archive2_compression} = < + + + +EOF + +$Lang{BackupPC_Archive2_parity} = < + + + +EOF + +$Lang{BackupPC_Archive2_split} = < + + + +EOF + # ----------------------------------- $Lang{Pool_Stat} = <El grupo tiene \${poolSize}GB incluyendo \$info->{"\${name}FileCnt"} archivos @@ -182,38 +328,42 @@ EOF # -------------------------------- $Lang{Only_privileged_users_can_view_queues_} = "Sólo los administradores pueden ver las colas."; # -------------------------------- +$Lang{Only_privileged_users_can_archive} = "ENG Only privileged users can Archive."; +# -------------------------------- $Lang{BackupPC__Queue_Summary} = "BackupPC: Resumen de la Cola"; # -------------------------------- $Lang{Backup_Queue_Summary} = < +

    \${h2("Resumen de la Cola de Usuarios")}

    Las siguientes solicitudes de usuarios están actualmente en cola: -

    - +
    \$fileHeader \$topCheckAll \$fileStr @@ -618,7 +817,6 @@ $Lang{Backup_browse_for__host} = < --> -
    EOF @@ -629,12 +827,11 @@ $Lang{DirHistory_backup_for__host} = "(ENGLISH) BackupPC: Directory backup histo # These two strings are used to build the links for directories and # file versions. Files are appended with a version number. # -$Lang{DirHistory_dirLink} = "(ENGLISH) dir"; -$Lang{DirHistory_fileLink} = "(ENGLISH) v"; +$Lang{DirHistory_dirLink} = "ENG dir"; +$Lang{DirHistory_fileLink} = "ENG v"; $Lang{DirHistory_for__host} = < This display shows each unique version of files across all the backups: @@ -655,9 +852,9 @@ the backups: \${h2("History of \${EscHTML(\$dirDisplay)}")}
    - -\$backupNumStr -\$backupTimeStr +
    Backup number
    Backup time
    +\$backupNumStr +\$backupTimeStr \$fileStr
    Backup number
    Backup time
    EOF @@ -668,38 +865,66 @@ $Lang{Restore___num_details_for__host} = "BackupServer: Restore #\$num Details f $Lang{Restore___num_details_for__host2 } = < - - - - - - - - - - - - - - - - - - - EOF +$Lang{checkAllHosts} = < +EOF + $Lang{fileHeader} = < + @@ -883,6 +1114,7 @@ $Lang{fileHeader} = < Dieses Verzeichnis in Backup #\$otherDirs browsen. +
  • ENG Dieses Verzeichnis in Backup browsen. EOF $Lang{Restore_Summary} = < Klicken Sie auf die Restore Nummer (Restore#) für mehr Details. -
  • Nummer \$Restores[\$i]{num}
    beauftragt von \$RestoreReq{user}
    Auftrag Zeitpunkt \$reqTime
    Ergebnis \$Restores[\$i]{result}
    Fehlermeldung \$Restores[\$i]{errorMsg}
    Quelle Computer \$RestoreReq{hostSrc}
    Quelle Backup Nr. \$RestoreReq{num}
    Quelle Freigabe \$RestoreReq{shareSrc}
    Ziel Computer \$RestoreReq{hostDest}
    Ziel Freigabe \$RestoreReq{shareDest}
    Start Zeitpunkt \$startTime
    Dauer \$duration min
    Anzahl Dateien \$Restores[\$i]{nFiles}
    Größe gesamt \${MB} MB
    Transferrate \$MBperSec MB/sec
    TarCreate Fehler \$Restores[\$i]{tarCreateErrs}
    Xfer Fehler \$Restores[\$i]{xferErrs}
    Xfer LOG Datei + + + + + + + + + + + + + + + + + + +
    Nummer \$Restores[\$i]{num}
    beauftragt von \$RestoreReq{user}
    Auftrag Zeitpunkt \$reqTime
    Ergebnis \$Restores[\$i]{result}
    Fehlermeldung \$Restores[\$i]{errorMsg}
    Quelle Computer \$RestoreReq{hostSrc}
    Quelle Backup Nr. \$RestoreReq{num}
    Quelle Freigabe \$RestoreReq{shareSrc}
    Ziel Computer \$RestoreReq{hostDest}
    Ziel Freigabe \$RestoreReq{shareDest}
    Start Zeitpunkt \$startTime
    Dauer \$duration min
    Anzahl Dateien \$Restores[\$i]{nFiles}
    Größe gesamt \${MB} MB
    Transferrate \$MBperSec MB/sec
    TarCreate Fehler \$Restores[\$i]{tarCreateErrs}
    Xfer Fehler \$Restores[\$i]{xferErrs}
    Xfer LOG Datei Anzeigen, Fehler
    -

    +

    \${h1("Datei/Verzeichnis Liste")}

    - - +
    Original Datei/Verzeichniswiederhergestellt nach
    + \$fileListStr
    Original Datei/Verzeichniswiederhergestellt nach
    EOF +# ------------------------------ +$Lang{Archive___num_details_for__host} = "ENG BackupPC: Archive #\$num details for \$host"; + +$Lang{Archive___num_details_for__host2 } = < + + + + + + + + + +
    Number \$Archives[\$i]{num}
    Requested by \$ArchiveReq{user}
    Request time \$reqTime
    Result \$Archives[\$i]{result}
    Error Message \$Archives[\$i]{errorMsg}
    Start time \$startTime
    Duration \$duration min
    Xfer log file +View, +Errors +
    +

    +\${h1("Host list")} +

    + + +\$HostListStr +
    HostBackup Number
    +EOF + # ----------------------------------- $Lang{Email_Summary} = "BackupServer: e-mail Übersicht"; @@ -710,7 +935,7 @@ $Lang{BackupPC__Lib__new_failed__check_apache_error_log} = "BackupPC::Lib->new f $Lang{Wrong_user__my_userid_is___} = "Falscher User: meine userid ist \$>, anstatt \$uid" . "(\$Conf{BackupPCUser})\n"; -$Lang{Only_privileged_users_can_view_PC_summaries} = "Nur berechtigte User können die Computer Übersicht einsehen."; +# $Lang{Only_privileged_users_can_view_PC_summaries} = "Nur berechtigte User können die Computer Übersicht einsehen."; $Lang{Only_privileged_users_can_stop_or_start_backups} = "Nur berechtigte User können Backups starten und stoppen für" . " \${EscHTML(\$host)}."; @@ -731,6 +956,8 @@ $Lang{Only_privileged_users_can_restore_backup_files} = "Nur berechtigte User k $Lang{Bad_host_name} = "Falscher Computer Name \${EscHTML(\$host)}"; $Lang{You_haven_t_selected_any_files__please_go_Back_to} = "Sie haben keine Dateien selektiert; bitte gehen Sie zurück um" . " Dateien zu selektieren."; +$Lang{You_haven_t_selected_any_hosts} = "ENG You haven\'t selected any hosts; please go Back to" + . " select some hosts."; $Lang{Nice_try__but_you_can_t_put} = "Sie dürfen \'..\' nicht in Dateinamen verwenden"; $Lang{Host__doesn_t_exist} = "Computer \${EscHTML(\$In{hostDest})} existiert nicht"; $Lang{You_don_t_have_permission_to_restore_onto_host} = "Sie haben keine Berechtigung zum Restore auf Computer" @@ -743,17 +970,12 @@ $Lang{Empty_host_name} = "leerer Computer Name"; $Lang{Unknown_host_or_user} = "Unbekannter Computer oder User \${EscHTML(\$host)}"; $Lang{Only_privileged_users_can_view_information_about} = "Nur berechtigte User können Informationen sehen über" . " Computer \${EscHTML(\$host)}." ; +$Lang{Only_privileged_users_can_view_archive_information} = "ENG Only privileged users can view archive information."; $Lang{Only_privileged_users_can_view_restore_information} = "Nur berechtigte User können Restore Informationen einsehen."; $Lang{Restore_number__num_for_host__does_not_exist} = "Restore Nummer \$num für Computer \${EscHTML(\$host)} existiert" . " nicht."; - -$Lang{Unable_to_connect_to_BackupPC_server} = "Kann keine Verbindung zu BackupPC server herstellen", - "Dieses CGI script (\$MyURL) kann keine Verbindung zu BackupPC" - . " server auf \$Conf{ServerHost} port \$Conf{ServerPort} herstellen. Der Fehler" - . " war: \$err.", - "Möglicherweise ist der BackupPC server Prozess nicht gestartet oder es besteht ein" - . " Konfigurationsfehler. Bitte teilen Sie diese Fehlermeldung dem Systemadministrator mit."; - +$Lang{Archive_number__num_for_host__does_not_exist} = "ENG Archive number \$num for host \${EscHTML(\$host)} does" + . " not exist."; $Lang{Can_t_find_IP_address_for} = "Kann IP-Adresse für \${EscHTML(\$host)} nicht finden"; $Lang{host_is_a_DHCP_host} = <Backups sind für die nächsten \$hours Stunden deaktiviert. -(diese Zeit ändern). +({Stop_Dequeue_Archive})}&host=\$host\">diese Zeit ändern). EOF $Lang{tryIP} = " und \$StatusHost{dhcpHostIP}"; -$Lang{Host_Inhost} = "Computer \$In{host}"; +#$Lang{Host_Inhost} = "Computer \$In{host}"; $Lang{checkAll} = <

    +
     alles auswählen - +
    + ENG Select all + + +
    Name
    Name Typ Rechte Backup#
    - +
    Restore#
    + @@ -913,6 +1145,21 @@ Klicken Sie auf die Restore Nummer (Restore#) f

    EOF +$Lang{Archive_Summary} = < +Click on the archive number for more details. +

    Restore# Ergebnis Start Zeitpunkt Dauer/mins
    + + + + + +\$ArchiveStr +
    Archive# Result Start Date Dur/mins
    +

    +EOF + $Lang{BackupPC__Documentation} = "BackupServer: Dokumentation"; $Lang{No} = "nein"; @@ -928,7 +1175,7 @@ $Lang{off} = "aus"; $Lang{backupType_full} = "voll"; $Lang{backupType_incr} = "incr"; -$Lang{backupType_partial} = "(ENGLISH)partial"; +$Lang{backupType_partial} = "ENG partial"; $Lang{failed} = "fehler"; $Lang{success} = "erfolgreich"; @@ -946,12 +1193,15 @@ $Lang{Status_link_running} = "Link l $Lang{Reason_backup_done} = "Backup durchgeführt"; $Lang{Reason_restore_done} = "Restore durchgeführt"; +$Lang{Reason_archive_done} = "ENG archive done"; $Lang{Reason_nothing_to_do} = "kein Auftrag"; $Lang{Reason_backup_failed} = "Backup Fehler"; $Lang{Reason_restore_failed} = "Restore Fehler"; +$Lang{Reason_archive_failed} = "ENG archive failed"; $Lang{Reason_no_ping} = "nicht erreichbar"; $Lang{Reason_backup_canceled_by_user} = "Abbruch durch User"; $Lang{Reason_restore_canceled_by_user} = "Abbruch durch User"; +$Lang{Reason_archive_canceled_by_user} = "ENG archive canceled by user"; # --------- # Email messages diff --git a/lib/BackupPC/Lang/en.pm b/lib/BackupPC/Lang/en.pm index ff82605..5ada4fb 100644 --- a/lib/BackupPC/Lang/en.pm +++ b/lib/BackupPC/Lang/en.pm @@ -1,4 +1,4 @@ -#!/bin/perl -T +#!/bin/perl #my %lang; #use strict; @@ -83,7 +83,7 @@ $Lang{BackupPC_Server_Status}= < - +
    @@ -98,7 +98,7 @@ $Lang{BackupPC_Server_Status}= < -
    Host Type User
    +
    @@ -113,7 +113,7 @@ EOF # -------------------------------- $Lang{BackupPC__Server_Summary} = "BackupPC: Server Summary"; $Lang{BackupPC__Archive} = "BackupPC: Archive"; -$Lang{BackupPC_Summary}=< @@ -130,7 +130,7 @@ There are \$hostCntGood hosts that have been backed up, for a total of: (prior to pooling and compression).

    -
    Host Type User
    +
    @@ -148,7 +148,7 @@ There are \$hostCntGood hosts that have been backed up, for a total of:

    There are \$hostCntNone hosts with no backups.

    -

    Host User #Full
    +
    @@ -163,8 +163,7 @@ There are \$hostCntNone hosts with no backups.
    Host User #Full
    EOF -$Lang{BackupPC_Archive}=< + + +There are \$hostCntGood hosts that have been backed up for a total size of \${fullSizeTot}GB +

    +

    + + + + + + + + +\$strGood +\$checkAllHosts +
    Host User Backup Size
    +
    +

    + +EOF + +$Lang{BackupPC_Archive2} = < +\$HostListStr + +

    +\$hiddenStr + + + + + +\$paramStr + + + + +
    +EOF + +$Lang{BackupPC_Archive2_location} = < +
    Archive Location/Device
    Compression + None
    + gzip
    + bzip2 +
    Number of Parity Files
    Split output intoMegabytes
    - +

    +
    Host
    + \$strUser
    Host Hora Sol. Usuario
    -

    +

    \${h2("Resumen de Cola en Segundo Plano")}

    Las siguientes solicitudes en segundo plano están actualmente en cola: - - +

    +
    Host
    + \$strBg
    Host Hora Sol. Usuario
    -

    - +

    \${h2("Resumen de Cola de Comandos")}

    Los siguientes comandos están actualmente en cola: - - +

    +
    Host
    + @@ -242,8 +392,8 @@ $Lang{BackupPC__Log_File_History} = "BackupPC: Historial de Archivo de Registro" $Lang{Log_File_History__hdr} = < -
    Host Hora Sol. Usuario Comando
    - +
    File
    + \$str @@ -254,8 +404,8 @@ EOF $Lang{Recent_Email_Summary} = < -
    File Size Hora Modificación
    - +
    Destinatario
    + @@ -270,25 +420,29 @@ $Lang{Browse_backup__num_for__host} = "BackupPC: Hojear copia de seguridad \$num # ------------------------------ $Lang{Restore_Options_for__host} = "BackupPC: Opciones de restauración para \$host"; $Lang{Restore_Options_for__host2} = < Ha seleccionado los siguientes archivos/directorios de la unidad \$share, copia número #\$num:
      \$fileListStr
    -

    +

    Tiene tres opciones para restaurar estos archivos/directorios. Por favor, seleccione una de las siguientes opciones. -

    +

    \${h2("Opción 1: Restauración Directa")}

    +EOF + +$Lang{Restore_Options_for__host_Option1} = < +

    ¡Atención!: ¡Cualquier archivo existente con el mismo nombre que los que ha seleccionado será sobreescrito! - -
    +

    + @@ -297,8 +451,17 @@ seleccionado ser
    Destinatario Host Hora Asunto
    - +
    Restaurar los archivos al host + + + Search for available shares (NOT IMPLEMENTED)
    Restaurar los archivos a la unidad EOF +$Lang{Restore_Options_for__host_Option1_disabled} = < \${h2("Opción 2: Descargar archivo Zip")}

    Puede descargar un archivo comprimido (.zip) conteniendo todos los archivos y directorios que ha seleccionado. Después puede hacer uso de una aplicación local, como WinZip, para ver o extraer cualquiera de los archivos. -

    +

    ¡Atención!: Dependiendo de que archivos/carpetas haya seleccionado, este archivo puede ser muy grande. Podría tardar muchos minutos crear y transferir el archivo. Además necesitará suficiente espacio el el disco local para almacenarlo. -

    +

    @@ -347,13 +515,14 @@ EOF # ------------------------------ $Lang{Option_2__Download_Zip_archive2} = < \${h2("Opción 2: Descargar archivo Zip")}

    El programa Archive::Zip no está instalado, de modo que no podrá descargar un archivo comprimido zip. Por favor, solicite a su administrador de sistemas que instale Archive::Zip de www.cpan.org. -

    +

    EOF @@ -364,12 +533,12 @@ $Lang{Option_3__Download_Zip_archive} = < +

    ¡Atención!: Dependiendo de que archivos/carpetas haya seleccionado, este archivo puede ser muy grande. Podría tardar muchos minutos crear y transferir el archivo. Además necesitará suficiente espacio el el disco local para almacenarlo. -

    +

    @@ -422,7 +591,13 @@ $Lang{Reply_from_server_was___reply} = < La respuesta del servidor fué: \$reply

    -Go back to \$hostDest home page. +ENG Go back to \$hostDest home page. +EOF + +$Lang{BackupPC_Archive_Reply_from_server} = < +Reply from server was: \$reply EOF # ------------------------- @@ -435,7 +610,7 @@ $Lang{Host__host_Backup_Summary2} = < \$statusStr - +

    \${h2("Acciones del Usuario")}

    @@ -444,12 +619,13 @@ $Lang{Host__host_Backup_Summary2} = < - +

    \${h2("Resumen de Copia de Seguridad")}

    Haga click en el número de copia de seguridad para revisar y restaurar archivos. - - +

    +
    Copia Nº
    + @@ -462,11 +638,12 @@ Haga click en el n

    \$restoreStr - +

    +

    \${h2("Resumen de Errores de Transferencia")} -

    -

    Copia Nº Tipo Completo Fecha Inicio
    - +

    +
    Copia Nº
    + @@ -476,7 +653,7 @@ Haga click en el n \$errStr
    Copia Nº Tipo Ver Nº Xfer errs
    -

    +

    \${h2("Resumen de Total/Tamaño de Archivos Reutilizados")}

    @@ -484,13 +661,14 @@ Los archivos existentes son aquellos que ya est aquellos que se han añadido al lote. Los archivos vacíos y los errores SMB no cuentan en las cifras de reutilizados ni en la de nuevos. - - +

    +
    + - + @@ -503,18 +681,19 @@ ni en la de nuevos. \$sizeStr
    Totales Archivos Existentes Archivos Nuevos
    Copia Nº Tipo Nº Archivos
    -

    +

    \${h2("Resumen de Compresión")}

    Efectividad de compresión para los archivos ya existentes en el lote y los archivos nuevos comprimidos. - - +

    +
    + - + @@ -526,7 +705,29 @@ archivos nuevos comprimidos. \$compStr
    Archivos Existentes Archivos Nuevos
    Copia Nº
    Copia Nº Tipo Nivel Comp Tamaño/MB
    +

    +EOF + +$Lang{Host__host_Archive_Summary} = "BackupPC: Host \$host Archive Summary"; +$Lang{Host__host_Archive_Summary2} = < +\$warnStr +

      +\$statusStr +
    + +\${h2("User Actions")} +

    +

    + + + + +
    + +\$ArchiveStr + EOF # ------------------------- @@ -579,10 +780,10 @@ $Lang{Backup_browse_for__host} = < Está revisando la copia de seguridad Nº\$num, que comenzó hacia las \$backupTime (hace \$backupAge dias), \$filledBackup +
  • ENG Enter directory:
  • Haga click en uno de los directorios de abajo para revisar sus contenidos,
  • Haga click en un archivo para restaurarlo, -
  • (ENGLISH)You can view the backup history of the current directory. -
  • (ENGLISH)Enter directory: +
  • ENG You can view the backup history of the current directory. @@ -594,18 +795,15 @@ $Lang{Backup_browse_for__host} = <
    - +
    -
    \$dirStr
    -
    -
    - +
    \$fileHeader \$topCheckAll \$fileStr @@ -617,7 +815,6 @@ $Lang{Backup_browse_for__host} = < --> -
    EOF @@ -628,12 +825,11 @@ $Lang{DirHistory_backup_for__host} = "(ENGLISH) BackupPC: Directory backup histo # These two strings are used to build the links for directories and # file versions. Files are appended with a version number. # -$Lang{DirHistory_dirLink} = "(ENGLISH) dir"; -$Lang{DirHistory_fileLink} = "(ENGLISH) v"; +$Lang{DirHistory_dirLink} = "ENG dir"; +$Lang{DirHistory_fileLink} = "ENG v"; $Lang{DirHistory_for__host} = < This display shows each unique version of files across all the backups: @@ -654,9 +850,9 @@ the backups: \${h2("History of \${EscHTML(\$dirDisplay)}")}
    - -\$backupNumStr -\$backupTimeStr +
    Backup number
    Backup time
    +\$backupNumStr +\$backupTimeStr \$fileStr
    Backup number
    Backup time
    EOF @@ -667,38 +863,66 @@ $Lang{Restore___num_details_for__host} = "BackupPC: Detalles de la restauraci $Lang{Restore___num_details_for__host2 } = < - - - - - - - - - - - - - - - - - - - EOF +$Lang{checkAllHosts} = < +EOF + $Lang{fileHeader} = < + @@ -882,6 +1112,7 @@ $Lang{fileHeader} = < Explorar este directorio en copia de seguridad Nº\$otherDirs. +
  • ENG Select the backup you wish to view: EOF $Lang{Restore_Summary} = < Haga click en el número de restauración para ver sus detalles. -
  • Número \$Restores[\$i]{num}
    Solicitado por \$RestoreReq{user}
    Hora Petición \$reqTime
    Resultado \$Restores[\$i]{result}
    Mensaje de Error \$Restores[\$i]{errorMsg}
    Host Origen \$RestoreReq{hostSrc}
    Nº copia origen \$RestoreReq{num}
    Unidad origen \$RestoreReq{shareSrc}
    Host destino \$RestoreReq{hostDest}
    Unidad destino \$RestoreReq{shareDest}
    Hora comienzo \$startTime
    Duración \$duration min
    Número de archivos \$Restores[\$i]{nFiles}
    Tamaño total \${MB} MB
    Tasa de transferencia \$MBperSec MB/sec
    Errores creación Tar \$Restores[\$i]{tarCreateErrs}
    Errores de transferencia \$Restores[\$i]{xferErrs}
    Archivo registro de transferencia + + + + + + + + + + + + + + + + + + +
    Número \$Restores[\$i]{num}
    Solicitado por \$RestoreReq{user}
    Hora Petición \$reqTime
    Resultado \$Restores[\$i]{result}
    Mensaje de Error \$Restores[\$i]{errorMsg}
    Host Origen \$RestoreReq{hostSrc}
    Nº copia origen \$RestoreReq{num}
    Unidad origen \$RestoreReq{shareSrc}
    Host destino \$RestoreReq{hostDest}
    Unidad destino \$RestoreReq{shareDest}
    Hora comienzo \$startTime
    Duración \$duration min
    Número de archivos \$Restores[\$i]{nFiles}
    Tamaño total \${MB} MB
    Tasa de transferencia \$MBperSec MB/sec
    Errores creación Tar \$Restores[\$i]{tarCreateErrs}
    Errores de transferencia \$Restores[\$i]{xferErrs}
    Archivo registro de transferencia View, Errors
    -

    +

    \${h1("Lista de Archivos/Directorios")}

    - - +
    Dir/archivo originalRestaurado a
    + \$fileListStr
    Dir/archivo originalRestaurado a
    EOF +# ------------------------------ +$Lang{Archive___num_details_for__host} = "ENG BackupPC: Archive #\$num details for \$host"; + +$Lang{Archive___num_details_for__host2 } = < + + + + + + + + + +
    Number \$Archives[\$i]{num}
    Requested by \$ArchiveReq{user}
    Request time \$reqTime
    Result \$Archives[\$i]{result}
    Error Message \$Archives[\$i]{errorMsg}
    Start time \$startTime
    Duration \$duration min
    Xfer log file +View, +Errors +
    +

    +\${h1("Host list")} +

    + + +\$HostListStr +
    HostBackup Number
    +EOF + # ----------------------------------- $Lang{Email_Summary} = "BackupPC: Resumen de Correos"; @@ -709,7 +933,7 @@ $Lang{BackupPC__Lib__new_failed__check_apache_error_log} = "BackupPC::Lib->nuevo $Lang{Wrong_user__my_userid_is___} = "Usuario erróneo: mi userid es \$>, en lugar de \$uid" . "(\$Conf{BackupPCUser})\n"; -$Lang{Only_privileged_users_can_view_PC_summaries} = "Sólo los usuarios autorizados pueden ver los resúmenes de PC´s."; +# $Lang{Only_privileged_users_can_view_PC_summaries} = "Sólo los usuarios autorizados pueden ver los resúmenes de PC´s."; $Lang{Only_privileged_users_can_stop_or_start_backups} = "Sólo los usuarios autorizados pueden comenzar a detener las copias" . " \${EscHTML(\$host)}."; @@ -730,6 +954,8 @@ $Lang{Only_privileged_users_can_restore_backup_files} = "S $Lang{Bad_host_name} = "Nombre de host erróneo \${EscHTML(\$host)}"; $Lang{You_haven_t_selected_any_files__please_go_Back_to} = "No ha seleccionado nigún archivo; por favor, vuelva a" . " seleccione algunos archivos."; +$Lang{You_haven_t_selected_any_hosts} = "ENG You haven\'t selected any hosts; please go Back to" + . " select some hosts."; $Lang{Nice_try__but_you_can_t_put} = "Buen intento, pero no puede usar \'..\' en los nombres de archivo"; $Lang{Host__doesn_t_exist} = "El Host \${EscHTML(\$In{hostDest})} no existe"; $Lang{You_don_t_have_permission_to_restore_onto_host} = "No tiene autorización para restaurar en el host" @@ -742,17 +968,12 @@ $Lang{Empty_host_name} = "Nombre de host vac $Lang{Unknown_host_or_user} = "Unknown host or user \${EscHTML(\$host)}"; $Lang{Only_privileged_users_can_view_information_about} = "Sólo los usuarios autorizados pueden ver información del" . " host \${EscHTML(\$host)}." ; +$Lang{Only_privileged_users_can_view_archive_information} = "ENG Only privileged users can view archive information."; $Lang{Only_privileged_users_can_view_restore_information} = "Sólo los usuarios autorizados pueden ver información de restauración."; $Lang{Restore_number__num_for_host__does_not_exist} = "El número de restauración \$num del host \${EscHTML(\$host)} " . " no existe."; - -$Lang{Unable_to_connect_to_BackupPC_server} = "Imposible conectar al servidor BackupPC", - "Este script CGI (\$MyURL) no puede conectar al servidor BackupPC" - . " en \$Conf{ServerHost} puerto \$Conf{ServerPort}. El error" - . " fué: \$err.", - "Quizá el servidor BackupPC no está activo o hay un " - . " error de configuración. Por favor informe a su administrador de sistemas."; - +$Lang{Archive_number__num_for_host__does_not_exist} = "ENG Archive number \$num for host \${EscHTML(\$host)} does" + . " not exist."; $Lang{Can_t_find_IP_address_for} = "No puedo encontrar la dirección IP de \${EscHTML(\$host)}"; $Lang{host_is_a_DHCP_host} = <Las copias de seguridad se retrasarán durante \$hours hours -(Cambie este número). +({Stop_Dequeue_Archive})}&host=\$host\">Cambie este número). EOF $Lang{tryIP} = " y \$StatusHost{dhcpHostIP}"; -$Lang{Host_Inhost} = "Host \$In{host}"; +#$Lang{Host_Inhost} = "Host \$In{host}"; $Lang{checkAll} = <

    +
     Seleccionar todo - +
    + ENG Select all + + +
    Nombre
    Nombre Tipo Modo
    - +
    Restauración Nº
    + @@ -912,6 +1143,21 @@ Haga click en el n

    EOF +$Lang{Archive_Summary} = < +Click on the archive number for more details. +

    Restauración Nº Resultado Fecha Inicio Dur/mins
    + + + + + +\$ArchiveStr +
    Archive# Result Start Date Dur/mins
    +

    +EOF + $Lang{BackupPC__Documentation} = "BackupPC: Documentacion"; $Lang{No} = "no"; @@ -927,7 +1173,7 @@ $Lang{off} = "inactivo"; $Lang{backupType_full} = "completo"; $Lang{backupType_incr} = "incremental"; -$Lang{backupType_partial} = "(ENGLISH)partial"; +$Lang{backupType_partial} = "ENG partial"; $Lang{failed} = "fallido"; $Lang{success} = "éxito"; @@ -945,12 +1191,15 @@ $Lang{Status_link_running} = "conexi $Lang{Reason_backup_done} = "copia de seguridad realizada"; $Lang{Reason_restore_done} = "restauración realizada"; +$Lang{Reason_archive_done} = "ENG archive done"; $Lang{Reason_nothing_to_do} = "nada por hacer"; $Lang{Reason_backup_failed} = "copia de seguridad fallida"; $Lang{Reason_restore_failed} = "restauración fallida"; +$Lang{Reason_archive_failed} = "ENG archive failed"; $Lang{Reason_no_ping} = "no hay ping"; $Lang{Reason_backup_canceled_by_user} = "copia cancelada por el usuario"; $Lang{Reason_restore_canceled_by_user} = "restauración cancelada por el usuario"; +$Lang{Reason_archive_canceled_by_user} = "ENG archive canceled by user"; # --------- # Email messages diff --git a/lib/BackupPC/Lang/fr.pm b/lib/BackupPC/Lang/fr.pm index 268faa6..7459cf9 100644 --- a/lib/BackupPC/Lang/fr.pm +++ b/lib/BackupPC/Lang/fr.pm @@ -1,4 +1,4 @@ -#!/bin/perl -T +#!/bin/perl #my %Lang; #use strict; @@ -83,7 +83,7 @@ $Lang{BackupPC_Server_Status}= < - +
    @@ -98,7 +98,7 @@ $Lang{BackupPC_Server_Status}= < -
    Hôte Type Utilisateur
    +
    @@ -118,7 +118,7 @@ $Lang{BackupPC_Summary}=< Ce statut a été généré le \$now. -

    +

    \${h2("Hôtes avec de bonnes sauvegardes")}

    @@ -129,8 +129,9 @@ Il y a \$hostCntGood h

  • \$incrTot sauvegardes incrémentielles de tailles cumulées de \${incrSizeTot} Go (précédant la mise en commun et la compression). -
  • Hôte Type Utilisateur
    - +

    +
    Hôte
    + @@ -142,14 +143,13 @@ Il y a \$hostCntGood h \$strGood
    Hôte Utilisateur Nb complètes Complètes Âge/Jours Dernière tentative
    -

    - +

    \${h2("Hôtes sans sauvegardes")}

    Il y a \$hostCntNone hôtes sans sauvegardes.

    - - +
    Hôte
    + @@ -164,7 +164,6 @@ Il y a \$hostCntNone h EOF $Lang{BackupPC_Archive}=<
    Hôte Utilisateur Nb complètes Complètes Âge/jour