# 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.
fixes large file (>2GB) bugs. Large file bugs reported by Steve
Waltner.
-
#------------------------------------------------------------------------
# Version 2.0.0, 14 Jun 2003
#------------------------------------------------------------------------
-#!/bin/perl -T
+#!/bin/perl
#============================================================= -*-perl-*-
#
# BackupPC: Main program for PC backups.
#
#========================================================================
#
-# Version 2.1.0_CVS, released 3 Jul 2003.
+# Version 2.1.0_CVS, released 8 Feb 2004.
#
# See http://backuppc.sourceforge.net.
#
$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";
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" ) {
$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 = (.*)/ ) {
} 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));
-#!/bin/perl -T
+#!/bin/perl
#============================================================= -*-perl-*-
#
# BackupPC_archive: Archive files for an archive client.
#
#========================================================================
#
-# Version 2.1.0_CVS, released 3 Jul 2003.
+# Version 2.1.0_CVS, released 8 Feb 2004.
#
# See http://backuppc.sourceforge.net.
#
my $startTime = time();
-#my $Hosts = $bpc->HostInfoRead($client);
-
my $Dir = "$TopDir/pc/$client";
my @xferPid = ();
$stat{hostError} = $err;
exit(ArchiveCleanup($client));
}
+
#
# Re-read config file, so we can include the PC-specific config
#
}
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));
$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) );
}
return 1;
} else {
print(LOG $bpc->timeStamp, "Archive Complete\n");
- print("Archive Complete\n");
+ print("archive complete\n");
return;
}
}
--- /dev/null
+#!/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 <cbarratt@users.sourceforge.net>
+#
+# 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 <<EOF;
+Usage: $0 tarCreatePath splitPath parPath host bkupNum \\
+ compPath fileExt splitSize outLoc parFile share
+EOF
+ exit(1);
+}
+my $tarCreate = $ARGV[0];
+my $splitPath = $ARGV[1];
+my $parPath = $ARGV[2];
+my $host = $ARGV[3];
+my $bkupNum = $ARGV[4];
+my $compPath = $ARGV[5];
+my $fileExt = $ARGV[6];
+my $splitSize = $ARGV[7];
+my $outLoc = $ARGV[8];
+my $parfile = $ARGV[9];
+my $share = $ARGV[10];
+
+die("BackupPC::Lib->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);
+ }
+}
+++ /dev/null
-#!/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 <cbarratt@users.sourceforge.net>
-#
-# 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.*
+++ /dev/null
-#!/bin/sh
-#=============================================================
-#
-# BackupPC_archivetape: Archive files to a tape host
-#
-# DESCRIPTION
-#
-# Usage: BackupPC_archivecd tarCreate host backupnumber compression archiveloc share
-#
-# AUTHOR
-# Craig Barratt <cbarratt@users.sourceforge.net>
-#
-# 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
-#!/bin/perl -T
+#!/bin/perl
#============================================================= -*-perl-*-
#
# BackupPC_compressPool: Compress existing pool
#
#========================================================================
#
-# Version 2.1.0_CVS, released 3 Jul 2003.
+# Version 2.1.0_CVS, released 8 Feb 2004.
#
# See http://backuppc.sourceforge.net.
#
-#!/bin/perl -T
+#!/bin/perl
#============================================================= -*-perl-*-
#
# BackupPC_dump: Dump a single client.
#
#========================================================================
#
-# Version 2.1.0_CVS, released 3 Jul 2003.
+# Version 2.1.0_CVS, released 8 Feb 2004.
#
# See http://backuppc.sourceforge.net.
#
my $lastFull = 0;
my $lastIncr = 0;
my $partialIdx = -1;
+my $partialNum;
if ( $Conf{FullPeriod} == -1 && !$opts{f} && !$opts{i}
|| $Conf{FullPeriod} == -2 ) {
&& $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);
}
}
if ( $lastIncr < $Backups[$i]{startTime} );
} elsif ( $Backups[$i]{type} eq "partial" ) {
$partialIdx = $i;
+ $partialNum = $Backups[$i]{num};
}
}
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();
open(STDERR, ">&STDOUT");
close(STDIN);
open(STDIN, "<&RH");
+ alarm(0);
exec("$BinDir/BackupPC_tarExtract", $client, $shareName,
$Conf{CompressLevel});
print(LOG $bpc->timeStamp,
compress => $Conf{CompressLevel},
XferMethod => $Conf{XferMethod},
pidHandler => \&pidHandler,
+ partialNum => $partialNum,
});
if ( !defined($logMsg = $xfer->start()) ) {
-#!/bin/perl -T
+#!/bin/perl
#============================================================= -*-perl-*-
#
# BackupPC_link: link new backup into pool
#
#========================================================================
#
-# Version 2.1.0_CVS, released 3 Jul 2003.
+# Version 2.1.0_CVS, released 8 Feb 2004.
#
# See http://backuppc.sourceforge.net.
#
-#!/bin/perl -T
+#!/bin/perl
#============================================================= -*-perl-*-
#
# BackupPC_nightly: Nightly cleanup & statistics script.
#
#========================================================================
#
-# Version 2.1.0_CVS, released 3 Jul 2003.
+# Version 2.1.0_CVS, released 8 Feb 2004.
#
# See http://backuppc.sourceforge.net.
#
-#!/bin/perl -T
+#!/bin/perl
#============================================================= -*-perl-*-
#
# BackupPC_restore: Restore files to a client.
#
#========================================================================
#
-# Version 2.1.0_CVS, released 3 Jul 2003.
+# Version 2.1.0_CVS, released 8 Feb 2004.
#
# See http://backuppc.sourceforge.net.
#
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
-#!/bin/perl -T
+#!/bin/perl
#============================================================= -*-perl-*-
#
# BackupPC_sendEmail: send status emails to users and admins
#
#========================================================================
#
-# Version 2.1.0_CVS, released 3 Jul 2003.
+# Version 2.1.0_CVS, released 8 Feb 2004.
#
# See http://backuppc.sourceforge.net.
#
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 ) {
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;
}
-#!/bin/perl -T
+#!/bin/perl
#============================================================= -*-perl-*-
#
# BackupPC_serverMesg: Send one or more commands to the BackupPC server.
#
#========================================================================
#
-# Version 2.1.0_CVS, released 3 Jul 2003.
+# Version 2.1.0_CVS, released 8 Feb 2004.
#
# See http://backuppc.sourceforge.net.
#
-#!/bin/perl -T
+#!/bin/perl
#============================================================= -*-perl-*-
#
# BackupPC_tarCreate: create a tar archive of an existing dump
#
# 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
#
#========================================================================
#
-# Version 2.1.0_CVS, released 3 Jul 2003.
+# Version 2.1.0_CVS, released 8 Feb 2004.
#
# See http://backuppc.sourceforge.net.
#
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 <<EOF;
+usage: $0 [options] files/directories...
+ Required options:
+ -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 1048576 = 1MB)
+EOF
exit(1);
}
}
my $Host = $opts{h};
-if ( $opts{n} !~ /^(\d+)$/ ) {
+if ( $opts{n} !~ /^(-?\d+)$/ ) {
print(STDERR "$0: bad dump number '$opts{n}'\n");
exit(1);
}
my $ErrorCnt = 0;
my $i;
+$Num = $Backups[@Backups + $Num]{num} if ( -@Backups <= $Num && $Num < 0 );
for ( $i = 0 ; $i < @Backups ; $i++ ) {
last if ( $Backups[$i]{num} == $Num );
}
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
= '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);
#
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);
}
#
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);
###########################################################################
{
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
: "";
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},
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;
-#!/bin/perl -T
+#!/bin/perl
#============================================================= -*-perl-*-
#
# BackupPC_tarExtract: extract data from a dump
#
#========================================================================
#
-# Version 2.1.0_CVS, released 3 Jul 2003.
+# Version 2.1.0_CVS, released 8 Feb 2004.
#
# See http://backuppc.sourceforge.net.
#
$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;
-#!/bin/perl -T
+#!/bin/perl
#============================================================= -*-perl-*-
#
# BackupPC_trashClean: remove all the files in $TopDir/trash.
#
#========================================================================
#
-# Version 2.1.0_CVS, released 3 Jul 2003.
+# Version 2.1.0_CVS, released 8 Feb 2004.
#
# See http://backuppc.sourceforge.net.
#
-#!/bin/perl -T
+#!/bin/perl
#============================================================= -*-perl-*-
#
# BackupPC_zcat: uncompress files to stdout
#
#========================================================================
#
-# Version 2.1.0_CVS, released 3 Jul 2003.
+# Version 2.1.0_CVS, released 8 Feb 2004.
#
# See http://backuppc.sourceforge.net.
#
-#!/bin/perl -T
+#!/bin/perl
#============================================================= -*-perl-*-
#
# BackupPC_zipCreate: create a zip archive of an existing dump
#
#========================================================================
#
-# Version 2.1.0_CVS, released 3 Jul 2003.
+# Version 2.1.0_CVS, released 8 Feb 2004.
#
# See http://backuppc.sourceforge.net.
#
-#!/bin/perl -T
+#!/bin/perl
#============================================================= -*-perl-*-w
#
# BackupPC_Admin: Apache/CGI interface for BackupPC.
#
#========================================================================
#
-# Version 2.1.0_CVS, released 3 Jul 2003.
+# Version 2.1.0_CVS, released 8 Feb 2004.
#
# See http://backuppc.sourceforge.net.
#
$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}();
$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;
# 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
# $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
#
$Conf{CgiNavBarAdminAllHosts} = 0;
-#
-# Color scheme for CGI interface.
-#
-$Conf{CgiHeaderBgColor} = '#99cc33';
-
#
# Hilight colors based on status that are used in the PC summary page.
#
};
#
-# Additional CGI header text. For example, if you wanted each CGI page
-# to auto refresh every 900 seconds, you could add this text:
-#
-# <meta http-equiv="refresh" content="900">
+# Additional CGI header text.
#
$Conf{CgiHeaders} = '<meta http-equiv="pragma" content="no-cache">';
a {
font-family:arial,sans-serif;
- font-size:1em;
color:#3333ff
}
font-weight:bold;
background-color:#99cc33;
padding:3px;
- padding-left:10px
+ padding-left:6px;
+ margin-bottom:5px;
}
.h2 {
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 {
font-size:.8em;
font-family:arial,sans-serif;
text-decoration:none;
- line-height:15px
+ line-height:15px;
}
.fviewbold {
.histViewMis {
border-bottom:1px solid #000000;
- background-color:#ffdddd
+ background-color:#ffdddd;
}
div.NavMenu {
font-family:arial,sans-serif;
color:#000000;
font-weight:bold;
+ margin-bottom:2px;
}
#Content {
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);
}
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 {
#
#========================================================================
#
-# Version 2.1.0_CVS, released 3 Jul 2003.
+# Version 2.1.0_CVS, released 8 Feb 2004.
#
# See http://backuppc.sourceforge.net.
#
#
#========================================================================
#
-# Version 2.1.0_CVS, released 3 Jul 2003.
+# Version 2.1.0_CVS, released 8 Feb 2004.
#
# See http://backuppc.sourceforge.net.
#
#
#========================================================================
#
-# Version 2.1.0_CVS, released 3 Jul 2003.
+# Version 2.1.0_CVS, released 8 Feb 2004.
#
# See http://backuppc.sourceforge.net.
#
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");
<input type="hidden" name="archivehost" value="$In{'archivehost'}">
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},
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 {
} 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;
$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';
splitsize => $fullsplitsize,
host => $archivehost,
-
# list of hosts to restore
HostList => \@HostList,
BackupList => \@BackupList,
} 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;
#
#========================================================================
#
-# Version 2.1.0_CVS, released 3 Jul 2003.
+# Version 2.1.0_CVS, released 8 Feb 2004.
#
# See http://backuppc.sourceforge.net.
#
#
#========================================================================
#
-# Version 2.1.0_CVS, released 3 Jul 2003.
+# Version 2.1.0_CVS, released 8 Feb 2004.
#
# See http://backuppc.sourceforge.net.
#
#
#========================================================================
#
-# Version 2.1.0_CVS, released 3 Jul 2003.
+# Version 2.1.0_CVS, released 8 Feb 2004.
#
# See http://backuppc.sourceforge.net.
#
#
#========================================================================
#
-# Version 2.1.0_CVS, released 3 Jul 2003.
+# Version 2.1.0_CVS, released 8 Feb 2004.
#
# See http://backuppc.sourceforge.net.
#
#
#========================================================================
#
-# Version 2.1.0_CVS, released 3 Jul 2003.
+# Version 2.1.0_CVS, released 8 Feb 2004.
#
# See http://backuppc.sourceforge.net.
#
#
#========================================================================
#
-# Version 2.1.0_CVS, released 3 Jul 2003.
+# Version 2.1.0_CVS, released 8 Feb 2004.
#
# See http://backuppc.sourceforge.net.
#
}
ReadUserEmailInfo();
- if ($Conf{XferMethod} eq "archive" ) {
+ if ( $Conf{XferMethod} eq "archive" ) {
my @Archives = $bpc->ArchiveInfoRead($host);
my ($ArchiveStr,$warnStr);
}
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;
}
#
#========================================================================
#
-# Version 2.1.0_CVS, released 3 Jul 2003.
+# Version 2.1.0_CVS, released 8 Feb 2004.
#
# See http://backuppc.sourceforge.net.
#
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();
}
#
#========================================================================
#
-# Version 2.1.0_CVS, released 3 Jul 2003.
+# Version 2.1.0_CVS, released 8 Feb 2004.
#
# See http://backuppc.sourceforge.net.
#
sub Header
{
- my($title, $content) = @_;
+ my($title, $content, $noBrowse) = @_;
my @adminLinks = (
{ link => "", name => $Lang->{Status},
priv => 1},
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)}",
#
#========================================================================
#
-# Version 2.1.0_CVS, released 3 Jul 2003.
+# Version 2.1.0_CVS, released 8 Feb 2004.
#
# See http://backuppc.sourceforge.net.
#
#
#========================================================================
#
-# Version 2.1.0_CVS, released 3 Jul 2003.
+# Version 2.1.0_CVS, released 8 Feb 2004.
#
# See http://backuppc.sourceforge.net.
#
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);
}
#
#========================================================================
#
-# Version 2.1.0_CVS, released 3 Jul 2003.
+# Version 2.1.0_CVS, released 8 Feb 2004.
#
# See http://backuppc.sourceforge.net.
#
use strict;
use BackupPC::CGI::Lib qw(:all);
use Data::Dumper;
+use File::Path;
sub action
{
# Build list of hosts
#
my $hostDestSel;
+ my @hosts;
foreach my $h ( GetUserHosts() ) {
my $sel = " selected" if ( $h eq $In{host} );
$hostDestSel .= "<option value=\"$h\"$sel>${EscHTML($h)}</option>";
+ push(@hosts, $h);
}
#
#
$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
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;
[ \%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);
#
#========================================================================
#
-# Version 2.1.0_CVS, released 3 Jul 2003.
+# Version 2.1.0_CVS, released 8 Feb 2004.
#
# See http://backuppc.sourceforge.net.
#
#
#========================================================================
#
-# Version 2.1.0_CVS, released 3 Jul 2003.
+# Version 2.1.0_CVS, released 8 Feb 2004.
#
# See http://backuppc.sourceforge.net.
#
#
#========================================================================
#
-# Version 2.1.0_CVS, released 3 Jul 2003.
+# Version 2.1.0_CVS, released 8 Feb 2004.
#
# See http://backuppc.sourceforge.net.
#
#
#========================================================================
#
-# Version 2.1.0_CVS, released 3 Jul 2003.
+# Version 2.1.0_CVS, released 8 Feb 2004.
#
# See http://backuppc.sourceforge.net.
#
($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();
}
#
#========================================================================
#
-# Version 2.1.0_CVS, released 3 Jul 2003.
+# Version 2.1.0_CVS, released 8 Feb 2004.
#
# See http://backuppc.sourceforge.net.
#
#
#========================================================================
#
-# Version 2.1.0_CVS, released 3 Jul 2003.
+# Version 2.1.0_CVS, released 8 Feb 2004.
#
# See http://backuppc.sourceforge.net.
#
#
#========================================================================
#
-# Version 2.1.0_CVS, released 3 Jul 2003.
+# Version 2.1.0_CVS, released 8 Feb 2004.
#
# See http://backuppc.sourceforge.net.
#
$content .= "<pre>";
if ( $type eq "XferErr" || $type eq "XferErrbad"
- || $type eq "RestoreErr" ) {
+ || $type eq "RestoreErr"
+ || $type eq "ArchiveErr" ) {
my $skipped;
while ( 1 ) {
$_ = $fh->readLine();
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
|| /^\.\//
|| /^ /
) {
$content .= <<EOF;
</pre>
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();
}
#
#========================================================================
#
-# Version 2.1.0_CVS, released 3 Jul 2003.
+# Version 2.1.0_CVS, released 8 Feb 2004.
#
# See http://backuppc.sourceforge.net.
#
binmode(FH);
$fh = *FH;
}
- $compLevel = 0 if ( !$CompZlibOK );
+ $compLevel = 0 if ( !$CompZlibOK );
my $self = bless {
fh => $fh,
name => $fileName,
$self->{deflate} = $self->myDeflateInit;
} else {
$self->{inflate} = $self->myInflateInit;
+ $self->{inflateStart} = 1;
}
}
return $self;
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;
$self->{dataIn} = '';
$self->{eof} = 0;
$self->{inflate} = $self->myInflateInit;
+ $self->{inflateStart} = 1;
return sysseek($self->{fh}, 0, 0);
}
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} ) {
#
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
-#!/bin/perl -T
+#!/bin/perl
#
# by Manfred Herrmann (V1.1) (some typo errors + 3 new strings)
# CVS-> Revision ???
# --------------------------------
+$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} = <<EOF;
+ENG
+\${h1(qq{$Lang{Admin_Options}})}
+<br>
+\${h1("Server Control")}
+<form action="\$MyURL" method="get">
+<table>
+ <tr><td>Stop the server:<td><input type="submit" name="action" value="Stop">
+ <tr><td>Reload the server configuration:<td><input type="submit" name="action" value="Reload">
+</table>
+</form>
+\${h1("Server Configuration")}
+<ul>
+ <li><i>Other options can go here... e.g.,</i>
+ <li>Edit server configuration
+</ul>
+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} = <<EOF;
+ENG\${h1(qq{$Lang{Unable_to_connect_to_BackupPC_server}})}
+<form action="\$MyURL" method="get">
+The BackupPC server at <tt>\$Conf{ServerHost}</tt> port <tt>\$Conf{ServerPort}</tt>
+is not currently running (maybe you just stopped it, or haven't yet started it).<br>
+Do you want to start it?
+<input type="hidden" name="action" value="startServer">
+<input type="submit" value="Start Server" name="ignore">
+</form>
+EOF
+
# -----
$Lang{H_BackupPC_Server_Status} = "BackupServer Server Status";
<li> Die Server Prozess ID (PID) ist \$Info{pid}, auf Computer \$Conf{ServerHost},
Version \$Info{Version}, gestartet am \$serverStartTime.
<li> Dieser Status wurde am \$now generiert.
+<li> ENG The configuration was last loaded at \$configLoadTime.
<li> Computer werden am \$nextWakeupTime auf neue Aufträge geprüft.
<li> Weitere Informationen:
<ul>
\${h2("Aktuell laufende Aufträge")}
<p>
-<table border>
-<tr><td> Computer </td>
+<table class="tableStnd" border cellspacing="1" cellpadding="3">
+<tr class="tableheader"><td> Computer </td>
<td> Typ </td>
<td> User </td>
<td> Startzeit </td>
\${h2("Fehler, die näher analysiert werden müssen!")}
<p>
-<table border>
-<tr><td align="center"> Computer </td>
+<table class="tableStnd" border cellspacing="1" cellpadding="3">
+<tr class="tableheader"><td align="center"> Computer </td>
<td align="center"> Typ </td>
<td align="center"> User </td>
<td align="center"> letzter Versuch </td>
# --------------------------------
$Lang{BackupPC__Server_Summary} = "BackupServer: Übersicht";
+$Lang{BackupPC__Archive} = "ENG BackupPC: Archive";
$Lang{BackupPC_Summary}=<<EOF;
\${h1(qq{$Lang{BackupPC__Server_Summary}})}
<p>
Dieser Status wurde generiert am \$now.
-<p>
+</p>
\${h2("Computer mit erfolgreichen Backups")}
<p>
<li> \$incrTot Incrementelle Backups, Gesamtgröße \${incrSizeTot}GB
(vor pooling und Komprimierung).
</ul>
-<table border>
-<tr><td> Computer </td>
+</p>
+<table class="tableStnd" border cellpadding="3" cellspacing="1">
+<tr class="tableheader"><td> Computer </td>
<td align="center"> User </td>
<td align="center"> #Voll </td>
<td align="center"> Alter/Tage </td>
<td align="center"> Letzte Aktion </td></tr>
\$strGood
</table>
-<p>
-
+<br><br>
\${h2("Computer ohne Backups")}
<p>
Es gibt \$hostCntNone Computer ohne Backups !!!.
<p>
-<table border>
-<tr><td> Computer </td>
+<table class="tableStnd" border cellpadding="3" cellspacing="1">
+<tr class="tableheader"><td> Computer </td>
<td align="center"> User </td>
<td align="center"> #Voll </td>
<td align="center"> Alter/Tage </td>
</table>
EOF
+$Lang{BackupPC_Archive} = <<EOF;
+ENG\${h1(qq{$Lang{BackupPC__Archive}})}
+<script language="javascript" type="text/javascript">
+<!--
+
+ function checkAll(location)
+ {
+ for (var i=0;i<document.form1.elements.length;i++)
+ {
+ var e = document.form1.elements[i];
+ if ((e.checked || !e.checked) && e.name != \'all\') {
+ if (eval("document.form1."+location+".checked")) {
+ e.checked = true;
+ } else {
+ e.checked = false;
+ }
+ }
+ }
+ }
+
+ function toggleThis(checkbox)
+ {
+ var cb = eval("document.form1."+checkbox);
+ cb.checked = !cb.checked;
+ }
+
+//-->
+</script>
+
+There are \$hostCntGood hosts that have been backed up for a total size of \${fullSizeTot}GB
+<p>
+<form name="form1" method="post" action="\$MyURL">
+<input type="hidden" name="fcbMax" value="\$checkBoxCnt">
+<input type="hidden" name="type" value="1">
+<input type="hidden" name="host" value="\${EscHTML(\$archHost)}">
+<input type="hidden" name="action" value="Archive">
+<table class="tableStnd" border cellpadding="3" cellspacing="1">
+<tr class="tableheader"><td align=center> Host</td>
+ <td align="center"> User </td>
+ <td align="center"> Backup Size </td>
+\$strGood
+\$checkAllHosts
+</table>
+</form>
+<p>
+
+EOF
+
+$Lang{BackupPC_Archive2} = <<EOF;
+ENG\${h1(qq{$Lang{BackupPC__Archive}})}
+About to archive the following hosts
+<ul>
+\$HostListStr
+</ul>
+<form action="\$MyURL" method="post">
+\$hiddenStr
+<input type="hidden" name="action" value="Archive">
+<input type="hidden" name="host" value="\${EscHTML(\$archHost)}">
+<input type="hidden" name="type" value="2">
+<input type="hidden" value="0" name="archive_type">
+<table class="tableStnd" border cellspacing="1" cellpadding="3">
+\$paramStr
+<tr>
+ <td colspan=2><input type="submit" value="Start the Archive" name=""></td>
+</tr>
+</form>
+</table>
+EOF
+
+$Lang{BackupPC_Archive2_location} = <<EOF;
+ENG<tr>
+ <td>Archive Location/Device</td>
+ <td><input type="text" value="\$ArchiveDest" name="archive_device"></td>
+</tr>
+EOF
+
+$Lang{BackupPC_Archive2_compression} = <<EOF;
+ENG<tr>
+ <td>Compression</td>
+ <td>
+ <input type="radio" value="0" name="compression" \$ArchiveCompNone>None<br>
+ <input type="radio" value="1" name="compression" \$ArchiveCompGzip>gzip<br>
+ <input type="radio" value="2" name="compression" \$ArchiveCompBzip2>bzip2
+ </td>
+</tr>
+EOF
+
+$Lang{BackupPC_Archive2_parity} = <<EOF;
+ENG<tr>
+ <td>Number of Parity Files</td>
+ <td><input type="numeric" value="\$ArchivePar" name="par"></td>
+</tr>
+EOF
+
+$Lang{BackupPC_Archive2_split} = <<EOF;
+ENG<tr>
+ <td>Split output into</td>
+ <td><input type="numeric" value="\$ArchiveSplit" name="splitsize">Megabytes</td>
+</tr>
+EOF
+
# -----------------------------------
$Lang{Pool_Stat} = <<EOF;
<li>Der Pool hat eine Größe von \${poolSize}GB und enthält \$info->{"\${name}FileCnt"} Dateien und \$info->{"\${name}DirCnt"} Verzeichnisse (Stand \$poolTime).
# --------------------------------
$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} = <<EOF;
\${h1("Backup Warteschlangen Übersicht")}
-<p>
+<br><br>
\${h2("User Warteschlange Übersicht")}
<p>
Die folgenden User Aufträge sind eingereiht:
-<table border>
-<tr><td> Computer </td>
+</p>
+<table class="tableStnd" border cellspacing="1" cellpadding="3" width="80%">
+<tr class="tableheader"><td> Computer </td>
<td> Uhrzeit </td>
<td> User </td></tr>
\$strUser
</table>
-<p>
+<br><br>
\${h2("Hintergrund Warteschlange Übersicht")}
<p>
Die folgenden Hintergrund Aufträge sind eingereiht:
-<table border>
-<tr><td> Computer </td>
+</p>
+<table class="tableStnd" border cellspacing="1" cellpadding="3" width="80%">
+<tr class="tableheader"><td> Computer </td>
<td> Uhrzeit </td>
<td> User </td></tr>
\$strBg
</table>
-<p>
-
+<br><br>
\${h2("Kommando Warteschlange Übersicht")}
<p>
Die folgenden Kommando Aufträge sind eingereiht:
-<table border>
-<tr><td> Computer </td>
+</p>
+<table class="tableStnd" border cellspacing="1" cellpadding="3" width="80%">
+<tr class="tableheader"><td> Computer </td>
<td> Uhrzeit </td>
<td> User </td>
<td> Kommando </td></tr>
$Lang{Log_File_History__hdr} = <<EOF;
\${h1("LOG Datei Historie \$hdr")}
<p>
-<table border>
-<tr><td align="center"> Datei </td>
+<table class="tableStnd" border cellspacing="1" cellpadding="3" width="80%">
+<tr class="tableheader"><td align="center"> Datei </td>
<td align="center"> Größe </td>
<td align="center"> letzte Änderung </td></tr>
\$str
$Lang{Recent_Email_Summary} = <<EOF;
\${h1("Letzte e-mail Übersicht (Sortierung nach Zeitpunkt)")}
<p>
-<table border>
-<tr><td align="center"> Empfänger </td>
+<table class="tableStnd" border cellspacing="1" cellpadding="3" width="80%">
+<tr class="tableheader"><td align="center"> Empfänger </td>
<td align="center"> Computer </td>
<td align="center"> Zeitpunkt </td>
<td align="center"> Titel </td></tr>
# ------------------------------
$Lang{Restore_Options_for__host} = "BackupServer: Restore Optionen für \$host";
$Lang{Restore_Options_for__host2} = <<EOF;
+\${h1("Restore Optionen für \$host")}
<p>
Sie haben die folgenden Dateien/Verzeichnisse von Freigabe \$share selektiert, von Backup Nummer #\$num:
<ul>
\$fileListStr
</ul>
-<p>
+</p><p>
Sie haben drei verschiedene Möglichkeiten zur Wiederherstellung (Restore) der Dateien/Verzeichnisse.
Bitte wählen Sie eine der folgenden Möglichkeiten:.
-<p>
+</p>
\${h2("Möglichkeit 1: Direct Restore")}
<p>
+EOF
+
+$Lang{Restore_Options_for__host_Option1} = <<EOF;
Sie können diese Wiederherstellung starten um die Dateien/Verzeichnisse direkt auf den Computer
\$host wiederherzustellen. Alternativ können Sie einen anderen Computer und/oder Freigabe als Ziel angeben.
-<p>
-<b><font color="#FF0000">Warnung:</font></b> alle aktuell existierenden Dateien/Verzeichnisse die bereits vorhanden sind
+</p><p>
+<b>Warnung:</b> 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)
-
-<form action="\$MyURL" method="post">
+</p>
+<form action="\$MyURL" method="post" name="direct">
<input type="hidden" name="host" value="\${EscHTML(\$host)}">
<input type="hidden" name="num" value="\$num">
<input type="hidden" name="type" value="3">
<table border="0">
<tr>
<td>Restore auf Computer</td>
- <td><input type="text" size="40" value="\${EscHTML(\$host)}"
- name="hostDest"></td>
+ <td><!--<input type="text" size="40" value="\${EscHTML(\$host)}"
+ name="hostDest">-->
+ <select name="hostDest" onChange="document.direct.shareDest.value=''">
+ \$hostDestSel
+ </select>
+ <script language="Javascript">
+ function myOpen(URL) {
+ window.open(URL,'','width=500,height=400');
+ }
+ </script>
+ <a href="javascript:myOpen('\$MyURL?action=findShares&host='+document.direct.hostDest.options.value)">Search for available shares (NOT IMPLEMENTED)</a></td>
</tr><tr>
<td>Restore auf Freigabe</td>
<td><input type="text" size="40" value="\${EscHTML(\$share)}"
</form>
EOF
+$Lang{Restore_Options_for__host_Option1_disabled} = <<EOF;
+ENG Direct restore has been disabled for host \${EscHTML(\$hostDest)}.
+Please select one of the other restore options.
+EOF
+
# ------------------------------
$Lang{Option_2__Download_Zip_archive} = <<EOF;
-
+<p>
\${h2("Möglichkeit 2: Download als Zip Archiv Datei")}
<p>
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.
-<p>
-<b><font color="#FF0000">Warnung:</font></b> Abhängig von der Anzahl und Größe der selektierten
+</p><p>
+<b>Warnung:</b> 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.
-<p>
+</p>
<form action="\$MyURL" method="post">
<input type="hidden" name="host" value="\${EscHTML(\$host)}">
<input type="hidden" name="num" value="\$num">
# ------------------------------
$Lang{Option_2__Download_Zip_archive2} = <<EOF;
+<p>
\${h2("Möglichkeit 2: Download als Zip Archiv Datei")}
<p>
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
<a href="http://www.cpan.org">www.cpan.org</a>.
-<p>
+</p>
EOF
Sie können eine Tar Archiv Datei downloaden, die alle selektierten Dateien/Verzeichnisse
enthält. Mit einer lokalen Anwendung (z.B. tar, WinZIP...) können Sie dann
beliebige Dateien entpacken.
-<p>
-<b><font color="#FF0000">Warnung:</font></b> Abhängig von der Anzahl und Größe der selektierten
+</p><p>
+<b>Warnung:</b> 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.
-<p>
+</p>
<form action="\$MyURL" method="post">
<input type="hidden" name="host" value="\${EscHTML(\$host)}">
<input type="hidden" name="num" value="\$num">
Zurück zur <a href="\$MyURL?host=\$hostDest">\$hostDest home page</a>.
EOF
+$Lang{BackupPC_Archive_Reply_from_server} = <<EOF;
+ENG\${h1(\$str)}
+<p>
+Reply from server was: \$reply
+EOF
+
# -------------------------
$Lang{Host__host_Backup_Summary} = "BackupServer: Computer \$host Backup Übersicht";
<ul>
\$statusStr
</ul>
-
+</p>
\${h2("User Aktionen")}
<p>
<form action="\$MyURL" method="get">
<input type="submit" value="$Lang{Start_Full_Backup}" name="action">
<input type="submit" value="$Lang{Stop_Dequeue_Backup}" name="action">
</form>
-
+</p>
\${h2("Backup Übersicht")}
<p>
Klicken Sie auf die Backup-Nummer um Dateien zu browsen und bei Bedarf wiederherzustellen.
-<table border>
-<tr><td align="center"> Backup# </td>
+</p>
+<table class="tableStnd" border cellspacing="1" cellpadding="3">
+<tr class="tableheader"><td align="center"> Backup# </td>
<td align="center"> Typ </td>
<td align="center"> Filled </td>
<td align="center"> Start Zeitpunkt </td>
<p>
\$restoreStr
-
+</p>
+<br><br>
\${h2("Xfer Fehler Übersicht - bitte kontrollieren")}
-<p>
-<table border>
-<tr><td align="center"> Backup# </td>
+<br><br>
+<table class="tableStnd" border cellspacing="1" cellpadding="3" width="80%">
+<tr class="tableheader"><td align="center"> Backup# </td>
<td align="center"> Typ </td>
<td align="center"> Anzeigen </td>
<td align="center"> #Xfer Fehler </td>
</tr>
\$errStr
</table>
-<p>
+<br><br>
\${h2("Datei Größe/Anzahl Wiederverwendungs Übersicht")}
<p>
-"Bestehende Dateien" bedeutet bereits im Pool vorhanden.<BR>
-"Neue Dateien" bedeutet neu zum Pool hinzugefügt.<BR>
+"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.
-<table border>
-<tr><td colspan="2"></td>
+</p>
+<table class="tableStnd" border cellspacing="1" cellpadding="3" width="80%">
+<tr class="tableheader"><td colspan="2" bgcolor="#ffffff"></td>
<td align="center" colspan="3"> Gesamt </td>
<td align="center" colspan="2"> Bestehende Dateien </td>
<td align="center" colspan="2"> Neue Dateien </td>
</tr>
-<tr>
+<tr class="tableheader">
<td align="center"> Backup# </td>
<td align="center"> Typ </td>
<td align="center"> #Dateien </td>
</tr>
\$sizeStr
</table>
-<p>
+<br><br>
\${h2("Kompression Übersicht")}
<p>
Kompressionsergebnisse für bereits im Backup-Pool vorhandene und für neu komprimierte Dateien.
-<table border>
-<tr><td colspan="3"></td>
+</p>
+<table class="tableStnd" border cellspacing="1" cellpadding="3" width="80%">
+<tr class="tableheader"><td colspan="3" bgcolor="#ffffff"></td>
<td align="center" colspan="3"> vorhandene Dateien </td>
<td align="center" colspan="3"> neue Dateien </td>
</tr>
-<tr><td align="center"> Backup# </td>
+<tr class="tableheader"><td align="center"> Backup# </td>
<td align="center"> Typ </td>
<td align="center"> Comp Level </td>
<td align="center"> Größe/MB </td>
</tr>
\$compStr
</table>
+<br><br>
+EOF
+
+$Lang{Host__host_Archive_Summary} = "BackupPC: Host \$host Archive Summary";
+$Lang{Host__host_Archive_Summary2} = <<EOF;
+ENG\${h1("Host \$host Archive Summary")}
<p>
+\$warnStr
+<ul>
+\$statusStr
+</ul>
+
+\${h2("User Actions")}
+<p>
+<form action="\$MyURL" method="get">
+<input type="hidden" name="archivehost" value="\$host">
+<input type="hidden" name="host" value="\$host">
+<input type="submit" value="$Lang{Start_Archive}" name="action">
+<input type="submit" value="$Lang{Stop_Dequeue_Archive}" name="action">
+</form>
+
+\$ArchiveStr
+
EOF
# -------------------------
<li> Sie browsen das Backup #\$num, erstellt am \$backupTime
(vor \$backupAge Tagen),
\$filledBackup
+<li> ENG Enter directory: <input type="text" name="dir" size="50" maxlength="4096" value="\${EscHTML(\$dir)}"> <input type="submit" value="\$Lang->{Go}" name="Submit">
<li> Klicken Sie auf ein Verzeichnis um dieses zu durchsuchen,
<li> Klicken Sie auf eine Datei um diese per download wiederherzustellen,
-<li> (ENGLISH)You can view the backup <a href="\$MyURL?action=dirHistory&host=\${EscURI(\$host)}&share=\$shareURI&dir=\$pathURI">history</a> of the current directory.
-<li> (ENGLISH)Enter directory: <input type="text" name="dir" size="50" maxlength="4096" value="\${EscHTML(\$dir)}"> <input type="submit" value="\$Lang->{Go}" name="Submit">
+<li> ENG You can view the backup <a href="\$MyURL?action=dirHistory&host=\${EscURI(\$host)}&share=\$shareURI&dir=\$pathURI">history</a> of the current directory.
</ul>
</form>
<input type="hidden" name="fcbMax" value="\$checkBoxCnt">
<input type="hidden" name="action" value="$Lang{Restore}">
<br>
-<table>
+<table width="100%">
<tr><td valign="top">
- <!--Navigate here:-->
<br><table align="center" border="0" cellpadding="0" cellspacing="0" bgcolor="#ffffff">
\$dirStr
</table>
</td><td width="3%">
</td><td valign="top">
- <!--Restore files here:-->
<br>
- <table cellpadding="0" cellspacing="0" bgcolor="#333333"><tr><td>
- <table border="0" width="100%" align="left" cellpadding="2" cellspacing="1">
+ <table border="0" width="100%" align="left" cellpadding="3" cellspacing="1">
\$fileHeader
\$topCheckAll
\$fileStr
This is now in the checkAll row
<input type="submit" name="Submit" value="Restore der Selektion">
-->
-</td></tr></table>
</form>
EOF
# 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} = <<EOF;
-\${h1("Directory backup history for \$host")}
-(ENGLISH)
+ENG\${h1("Directory backup history for \$host")}
<p>
This display shows each unique version of files across all
the backups:
\${h2("History of \${EscHTML(\$dirDisplay)}")}
<br>
-<table border bgcolor="#ffffcc">
-<tr bgcolor="\$Conf{CgiHeaderBgColor}"><td>Backup number</td>\$backupNumStr</tr>
-<tr bgcolor="\$Conf{CgiHeaderBgColor}"><td>Backup time</td>\$backupTimeStr</tr>
+<table cellspacing="2" cellpadding="3">
+<tr class="fviewheader"><td>Backup number</td>\$backupNumStr</tr>
+<tr class="fviewheader"><td>Backup time</td>\$backupTimeStr</tr>
\$fileStr
</table>
EOF
$Lang{Restore___num_details_for__host2 } = <<EOF;
\${h1("Restore #\$num Details für Computer \$host")}
<p>
-<table border>
-<tr><td> Nummer </td><td> \$Restores[\$i]{num} </td></tr>
-<tr><td> beauftragt von </td><td> \$RestoreReq{user} </td></tr>
-<tr><td> Auftrag Zeitpunkt </td><td> \$reqTime </td></tr>
-<tr><td> Ergebnis </td><td> \$Restores[\$i]{result} </td></tr>
-<tr><td> Fehlermeldung </td><td> \$Restores[\$i]{errorMsg} </td></tr>
-<tr><td> Quelle Computer </td><td> \$RestoreReq{hostSrc} </td></tr>
-<tr><td> Quelle Backup Nr. </td><td> \$RestoreReq{num} </td></tr>
-<tr><td> Quelle Freigabe </td><td> \$RestoreReq{shareSrc} </td></tr>
-<tr><td> Ziel Computer </td><td> \$RestoreReq{hostDest} </td></tr>
-<tr><td> Ziel Freigabe </td><td> \$RestoreReq{shareDest} </td></tr>
-<tr><td> Start Zeitpunkt </td><td> \$startTime </td></tr>
-<tr><td> Dauer </td><td> \$duration min </td></tr>
-<tr><td> Anzahl Dateien </td><td> \$Restores[\$i]{nFiles} </td></tr>
-<tr><td> Größe gesamt </td><td> \${MB} MB </td></tr>
-<tr><td> Transferrate </td><td> \$MBperSec MB/sec </td></tr>
-<tr><td> TarCreate Fehler </td><td> \$Restores[\$i]{tarCreateErrs} </td></tr>
-<tr><td> Xfer Fehler </td><td> \$Restores[\$i]{xferErrs} </td></tr>
-<tr><td> Xfer LOG Datei </td><td>
+<table class="tableStnd" border cellspacing="1" cellpadding="3" width="50%">
+<tr><td class="tableheader"> Nummer </td><td class="border"> \$Restores[\$i]{num} </td></tr>
+<tr><td class="tableheader"> beauftragt von </td><td class="border"> \$RestoreReq{user} </td></tr>
+<tr><td class="tableheader"> Auftrag Zeitpunkt </td><td class="border"> \$reqTime </td></tr>
+<tr><td class="tableheader"> Ergebnis </td><td class="border"> \$Restores[\$i]{result} </td></tr>
+<tr><td class="tableheader"> Fehlermeldung </td><td class="border"> \$Restores[\$i]{errorMsg} </td></tr>
+<tr><td class="tableheader"> Quelle Computer </td><td class="border"> \$RestoreReq{hostSrc} </td></tr>
+<tr><td class="tableheader"> Quelle Backup Nr. </td><td class="border"> \$RestoreReq{num} </td></tr>
+<tr><td class="tableheader"> Quelle Freigabe </td><td class="border"> \$RestoreReq{shareSrc} </td></tr>
+<tr><td class="tableheader"> Ziel Computer </td><td class="border"> \$RestoreReq{hostDest} </td></tr>
+<tr><td class="tableheader"> Ziel Freigabe </td><td class="border"> \$RestoreReq{shareDest} </td></tr>
+<tr><td class="tableheader"> Start Zeitpunkt </td><td class="border"> \$startTime </td></tr>
+<tr><td class="tableheader"> Dauer </td><td class="border"> \$duration min </td></tr>
+<tr><td class="tableheader"> Anzahl Dateien </td><td class="border"> \$Restores[\$i]{nFiles} </td></tr>
+<tr><td class="tableheader"> Größe gesamt </td><td class="border"> \${MB} MB </td></tr>
+<tr><td class="tableheader"> Transferrate </td><td class="border"> \$MBperSec MB/sec </td></tr>
+<tr><td class="tableheader"> TarCreate Fehler </td><td class="border"> \$Restores[\$i]{tarCreateErrs} </td></tr>
+<tr><td class="tableheader"> Xfer Fehler </td><td class="border"> \$Restores[\$i]{xferErrs} </td></tr>
+<tr><td class="tableheader"> Xfer LOG Datei </td><td class="border">
<a href="\$MyURL?action=view&type=RestoreLOG&num=\$Restores[\$i]{num}&host=\$host">Anzeigen</a>,
<a href="\$MyURL?action=view&type=RestoreErr&num=\$Restores[\$i]{num}&host=\$host">Fehler</a>
</tr></tr>
</table>
-<p>
+</p>
\${h1("Datei/Verzeichnis Liste")}
<p>
-<table border>
-<tr><td>Original Datei/Verzeichnis</td><td>wiederhergestellt nach</td></tr>
+<table class="tableStnd" border cellspacing="1" cellpadding="3" width="100%">
+<tr class="tableheader"><td>Original Datei/Verzeichnis</td><td>wiederhergestellt nach</td></tr>
\$fileListStr
</table>
EOF
+# ------------------------------
+$Lang{Archive___num_details_for__host} = "ENG BackupPC: Archive #\$num details for \$host";
+
+$Lang{Archive___num_details_for__host2 } = <<EOF;
+ENG\${h1("Archive #\$num Details for \$host")}
+<p>
+<table class="tableStnd" border cellspacing="1" cellpadding="3" width="50%">
+<tr><td class="tableheader"> Number </td><td class="border"> \$Archives[\$i]{num} </td></tr>
+<tr><td class="tableheader"> Requested by </td><td class="border"> \$ArchiveReq{user} </td></tr>
+<tr><td class="tableheader"> Request time </td><td class="border"> \$reqTime </td></tr>
+<tr><td class="tableheader"> Result </td><td class="border"> \$Archives[\$i]{result} </td></tr>
+<tr><td class="tableheader"> Error Message </td><td class="border"> \$Archives[\$i]{errorMsg} </td></tr>
+<tr><td class="tableheader"> Start time </td><td class="border"> \$startTime </td></tr>
+<tr><td class="tableheader"> Duration </td><td class="border"> \$duration min </td></tr>
+<tr><td class="tableheader"> Xfer log file </td><td class="border">
+<a href="\$MyURL?action=view&type=ArchiveLOG&num=\$Archives[\$i]{num}&host=\$host">View</a>,
+<a href="\$MyURL?action=view&type=ArchiveErr&num=\$Archives[\$i]{num}&host=\$host">Errors</a>
+</tr></tr>
+</table>
+<p>
+\${h1("Host list")}
+<p>
+<table class="tableStnd" border cellspacing="1" cellpadding="3" width="80%">
+<tr class="tableheader"><td>Host</td><td>Backup Number</td></tr>
+\$HostListStr
+</table>
+EOF
+
# -----------------------------------
$Lang{Email_Summary} = "BackupServer: e-mail Übersicht";
$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)}.";
$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"
$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} = <<EOF;
\$host ist ein DHCP Computer und ich kenne seine IP-Adresse nicht. Ich prüfte den
vom diesem Client Computer aus starten.
EOF
-########################
-# ok you can do it then
-########################
+# ------------------------------------
+# !! Server Mesg !!
+# ------------------------------------
$Lang{Backup_requested_on_DHCP__host} = "Backup angefordert für DHCP Computer \$host (\$In{hostIP}) durch"
. " \$User von \$ENV{REMOTE_ADDR}";
-
$Lang{Backup_requested_on__host_by__User} = "Backup angefordert für \$host durch \$User";
$Lang{Backup_stopped_dequeued_on__host_by__User} = "Backup gestoppt/gelöscht für \$host durch \$User";
-
$Lang{Restore_requested_to_host__hostDest__backup___num} = "Restore beauftragt nach Computer \$hostDest, von Backup #\$num,"
. " durch User \$User von Client \$ENV{REMOTE_ADDR}";
+$Lang{Archive_requested} = "ENG Archive requested by \$User from \$ENV{REMOTE_ADDR}";
# -------------------------------------------------
# ------- Stuff that was forgotten ----------------
$Lang{Status} = "Status";
$Lang{PC_Summary} = "Computer Übersicht";
$Lang{LOG_file} = "LOG Datei";
+$Lang{LOG_files} = "ENG LOG files";
$Lang{Old_LOGs} = "Alte LOGs";
$Lang{Email_summary} = "Email Übersicht";
$Lang{Config_file} = "Config Datei";
$Lang{Go} = "gehe zu";
$Lang{Hosts} = "Computer";
+$Lang{There_have_been_no_archives} = "<h2> ENG There have been no archives </h2>\n";
$Lang{This_PC_has_never_been_backed_up} = "<h2> Dieser Computer wurde nie gesichert!! </h2>\n";
$Lang{This_PC_is_used_by} = "<li>Dieser Computer wird betreut von \${UserLink(\$user)}";
$Lang{Backups_are_deferred_for_hours_hours_change_this_number} = <<EOF;
<li>Backups sind für die nächsten \$hours Stunden deaktiviert.
-(<a href=\"\$MyURL?action=Stoppen/Aussetzen%20Backup&host=\$host\">diese Zeit ändern</a>).
+(<a href=\"\$MyURL?action=\${EscURI(\$Lang->{Stop_Dequeue_Archive})}&host=\$host\">diese Zeit ändern</a>).
EOF
$Lang{tryIP} = " und \$StatusHost{dhcpHostIP}";
-$Lang{Host_Inhost} = "Computer \$In{host}";
+#$Lang{Host_Inhost} = "Computer \$In{host}";
$Lang{checkAll} = <<EOF;
-<tr bgcolor="#ffffcc"><td>
+<tr><td class="fviewborder">
<input type="checkbox" name="allFiles" onClick="return checkAll('allFiles');"> alles auswählen
-</td><td colspan="5" align="center">
+</td><td colspan="5" align="center" class="fviewborder">
<input type="submit" name="Submit" value="Restore der Selektion">
</td></tr>
EOF
+$Lang{checkAllHosts} = <<EOF;
+<tr><td class="fviewborder">
+<input type="checkbox" name="allFiles" onClick="return checkAll('allFiles');"> ENG Select all
+</td><td colspan="2" align="center" class="fviewborder">
+<input type="submit" name="Submit" value="ENG Archive selected hosts">
+</td></tr>
+EOF
+
$Lang{fileHeader} = <<EOF;
- <tr bgcolor="\$Conf{CgiHeaderBgColor}"><td align=center> Name</td>
+ <tr class="fviewheader"><td align=center> Name</td>
<td align="center"> Typ</td>
<td align="center"> Rechte</td>
<td align="center"> Backup#</td>
EOF
$Lang{Home} = "Home";
+$Lang{Browse} = "ENG Browse backups";
$Lang{Last_bad_XferLOG} = "Letzte bad XferLOG";
$Lang{Last_bad_XferLOG_errors_only} = "Letzte bad XferLOG (nur Fehler)";
EOF
$Lang{Visit_this_directory_in_backup} = <<EOF;
-<li> Dieses Verzeichnis in Backup #\$otherDirs browsen.
+<li> ENG Dieses Verzeichnis in Backup <select onChange="window.location=this.value">\$otherDirs </select> browsen.
EOF
$Lang{Restore_Summary} = <<EOF;
\${h2("Restore Übersicht")}
<p>
Klicken Sie auf die Restore Nummer (Restore#) für mehr Details.
-<table border>
-<tr><td align="center"> Restore# </td>
+<table class="tableStnd" border cellspacing="1" cellpadding="3" width="80%">
+<tr class="tableheader"><td align="center"> Restore# </td>
<td align="center"> Ergebnis </td>
<td align="right"> Start Zeitpunkt</td>
<td align="right"> Dauer/mins</td>
<p>
EOF
+$Lang{Archive_Summary} = <<EOF;
+ENG\${h2("Archive Summary")}
+<p>
+Click on the archive number for more details.
+<table class="tableStnd" border cellspacing="1" cellpadding="3" width="80%">
+<tr class="tableheader"><td align="center"> Archive# </td>
+ <td align="center"> Result </td>
+ <td align="right"> Start Date</td>
+ <td align="right"> Dur/mins</td>
+</tr>
+\$ArchiveStr
+</table>
+<p>
+EOF
+
$Lang{BackupPC__Documentation} = "BackupServer: Dokumentation";
$Lang{No} = "nein";
$Lang{backupType_full} = "voll";
$Lang{backupType_incr} = "incr";
-$Lang{backupType_partial} = "(ENGLISH)partial";
+$Lang{backupType_partial} = "ENG partial";
$Lang{failed} = "fehler";
$Lang{success} = "erfolgreich";
$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
-#!/bin/perl -T
+#!/bin/perl
#my %lang;
#use strict;
\${h2("Currently Running Jobs")}
<p>
-<table cellspacing="1" cellpadding="3">
+<table class="tableStnd" border cellspacing="1" cellpadding="3">
<tr class="tableheader"><td> Host </td>
<td> Type </td>
<td> User </td>
\${h2("Failures that need attention")}
<p>
-<table cellspacing="1" cellpadding="3">
+<table class="tableStnd" border cellspacing="1" cellpadding="3">
<tr class="tableheader"><td align="center"> Host </td>
<td align="center"> Type </td>
<td align="center"> User </td>
# --------------------------------
$Lang{BackupPC__Server_Summary} = "BackupPC: Server Summary";
$Lang{BackupPC__Archive} = "BackupPC: Archive";
-$Lang{BackupPC_Summary}=<<EOF;
+$Lang{BackupPC_Summary} = <<EOF;
\${h1(qq{$Lang{BackupPC__Server_Summary}})}
<p>
(prior to pooling and compression).
</ul>
</p>
-<table cellpadding="3" cellspacing="1">
+<table class="tableStnd" border cellpadding="3" cellspacing="1">
<tr class="tableheader"><td> Host </td>
<td align="center"> User </td>
<td align="center"> #Full </td>
<p>
There are \$hostCntNone hosts with no backups.
<p>
-<table cellpadding="3" cellspacing="1">
+<table class="tableStnd" border cellpadding="3" cellspacing="1">
<tr class="tableheader"><td> Host </td>
<td align="center"> User </td>
<td align="center"> #Full </td>
</table>
EOF
-$Lang{BackupPC_Archive}=<<EOF;
-
+$Lang{BackupPC_Archive} = <<EOF;
\${h1(qq{$Lang{BackupPC__Archive}})}
<script language="javascript" type="text/javascript">
<!--
<form name="form1" method="post" action="\$MyURL">
<input type="hidden" name="fcbMax" value="\$checkBoxCnt">
<input type="hidden" name="type" value="1">
+<input type="hidden" name="host" value="\${EscHTML(\$archHost)}">
<input type="hidden" name="action" value="Archive">
-<table cellpadding="3" cellspacing="1">
+<table class="tableStnd" border cellpadding="3" cellspacing="1">
<tr class="tableheader"><td align=center> Host</td>
<td align="center"> User </td>
<td align="center"> Backup Size </td>
\$strGood
\$checkAllHosts
-</form>
</table>
+</form>
<p>
-</table>
EOF
-$Lang{BackupPC_Archive2}=<<EOF;
+$Lang{BackupPC_Archive2} = <<EOF;
\${h1(qq{$Lang{BackupPC__Archive}})}
About to archive the following hosts
<ul>
<form action="\$MyURL" method="post">
\$hiddenStr
<input type="hidden" name="action" value="Archive">
+<input type="hidden" name="host" value="\${EscHTML(\$archHost)}">
<input type="hidden" name="type" value="2">
<input type="hidden" value="0" name="archive_type">
-<table border="1">
+<table class="tableStnd" border cellspacing="1" cellpadding="3">
+\$paramStr
+<tr>
+ <td colspan=2><input type="submit" value="Start the Archive" name=""></td>
+</tr>
+</form>
+</table>
+EOF
+
+$Lang{BackupPC_Archive2_location} = <<EOF;
<tr>
<td>Archive Location/Device</td>
<td><input type="text" value="\$ArchiveDest" name="archive_device"></td>
+</tr>
+EOF
+
+$Lang{BackupPC_Archive2_compression} = <<EOF;
<tr>
<td>Compression</td>
- <td><input type="radio" value="0" name="compression" \$ArchiveCompNone>None<br>
+ <td>
+ <input type="radio" value="0" name="compression" \$ArchiveCompNone>None<br>
<input type="radio" value="1" name="compression" \$ArchiveCompGzip>gzip<br>
- <input type="radio" value="2" name="compression" \$ArchiveCompBzip2>bzip2</tr>
+ <input type="radio" value="2" name="compression" \$ArchiveCompBzip2>bzip2
+ </td>
</tr>
+EOF
+
+$Lang{BackupPC_Archive2_parity} = <<EOF;
<tr>
<td>Number of Parity Files</td>
<td><input type="numeric" value="\$ArchivePar" name="par"></td>
</tr>
+EOF
+
+$Lang{BackupPC_Archive2_split} = <<EOF;
<tr>
- <td>Split output into:</td>
+ <td>Split output into</td>
<td><input type="numeric" value="\$ArchiveSplit" name="splitsize">Megabytes</td>
</tr>
-<tr>
- <td colspan=2><input type="submit" value="Start the Archive" name=""></td>
-</tr>
-</form>
-</table>
EOF
# -----------------------------------
<p>
The following user requests are currently queued:
</p>
-<table cellspacing="1" cellpadding="3" width="80%">
+<table class="tableStnd" border cellspacing="1" cellpadding="3" width="80%">
<tr class="tableheader"><td> Host </td>
<td> Req Time </td>
<td> User </td></tr>
<p>
The following background requests are currently queued:
</p>
-<table cellspacing="1" cellpadding="3" width="80%">
+<table class="tableStnd" border cellspacing="1" cellpadding="3" width="80%">
<tr class="tableheader"><td> Host </td>
<td> Req Time </td>
<td> User </td></tr>
<p>
The following command requests are currently queued:
</p>
-<table cellspacing="1" cellpadding="3" width="80%">
+<table class="tableStnd" border cellspacing="1" cellpadding="3" width="80%">
<tr class="tableheader"><td> Host </td>
<td> Req Time </td>
<td> User </td>
$Lang{Log_File_History__hdr} = <<EOF;
\${h1("Log File History \$hdr")}
<p>
-<table cellspacing="1" cellpadding="3" width="100%">
+<table class="tableStnd" border cellspacing="1" cellpadding="3" width="80%">
<tr class="tableheader"><td align="center"> File </td>
<td align="center"> Size </td>
<td align="center"> Modification time </td></tr>
$Lang{Recent_Email_Summary} = <<EOF;
\${h1("Recent Email Summary (Reverse time order)")}
<p>
-<table cellspacing="1" cellpadding="3" width="100%">
+<table class="tableStnd" border cellspacing="1" cellpadding="3" width="80%">
<tr class="tableheader"><td align="center"> Recipient </td>
<td align="center"> Host </td>
<td align="center"> Time </td>
</p>
\${h2("Option 1: Direct Restore")}
<p>
+EOF
+
+$Lang{Restore_Options_for__host_Option1} = <<EOF;
You can start a restore that will restore these files directly onto
\$host.
</p><p>
</form>
EOF
+$Lang{Restore_Options_for__host_Option1_disabled} = <<EOF;
+Direct restore has been disabled for host \${EscHTML(\$hostDest)}.
+Please select one of the other restore options.
+EOF
+
# ------------------------------
$Lang{Option_2__Download_Zip_archive} = <<EOF;
-
+<p>
\${h2("Option 2: Download Zip archive")}
<p>
You can download a Zip archive containing all the files/directories you have
# ------------------------------
$Lang{Option_2__Download_Zip_archive2} = <<EOF;
+<p>
\${h2("Option 2: Download Zip archive")}
<p>
Archive::Zip is not installed so you will not be able to download a
<p>
Click on the backup number to browse and restore backup files.
</p>
-<table cellspacing="1" cellpadding="3" width="100%">
+<table class="tableStnd" border cellspacing="1" cellpadding="3">
<tr class="tableheader"><td align="center"> Backup# </td>
<td align="center"> Type </td>
<td align="center"> Filled </td>
<br><br>
\${h2("Xfer Error Summary")}
<br><br>
-<table cellspacing="1" cellpadding="3" width="100%">
+<table class="tableStnd" border cellspacing="1" cellpadding="3" width="80%">
<tr class="tableheader"><td align="center"> Backup# </td>
<td align="center"> Type </td>
<td align="center"> View </td>
to the pool.
Empty files and SMB errors aren\'t counted in the reuse and new counts.
</p>
-<table cellspacing="1" cellpadding="3" width="100%">
+<table class="tableStnd" border cellspacing="1" cellpadding="3" width="80%">
<tr class="tableheader"><td colspan="2" bgcolor="#ffffff"></td>
<td align="center" colspan="3"> Totals </td>
<td align="center" colspan="2"> Existing Files </td>
Compression performance for files already in the pool and newly
compressed files.
</p>
-<table cellspacing="1" cellpadding="3" width="100%">
+<table class="tableStnd" border cellspacing="1" cellpadding="3" width="80%">
<tr class="tableheader"><td colspan="3" bgcolor="#ffffff"></td>
<td align="center" colspan="3"> Existing Files </td>
<td align="center" colspan="3"> New Files </td>
<input type="submit" value="$Lang{Stop_Dequeue_Archive}" name="action">
</form>
-
\$ArchiveStr
EOF
$Lang{Restore___num_details_for__host2 } = <<EOF;
\${h1("Restore #\$num Details for \$host")}
<p>
-<table cellspacing="1" cellpadding="3" width="50%">
+<table class="tableStnd" border cellspacing="1" cellpadding="3" width="50%">
<tr><td class="tableheader"> Number </td><td class="border"> \$Restores[\$i]{num} </td></tr>
<tr><td class="tableheader"> Requested by </td><td class="border"> \$RestoreReq{user} </td></tr>
<tr><td class="tableheader"> Request time </td><td class="border"> \$reqTime </td></tr>
<a href="\$MyURL?action=view&type=RestoreErr&num=\$Restores[\$i]{num}&host=\$host">Errors</a>
</tr></tr>
</table>
-<p>
+</p>
\${h1("File/Directory list")}
<p>
-<table cellspacing="1" cellpadding="3" width="100%">
+<table class="tableStnd" border cellspacing="1" cellpadding="3" width="100%">
<tr class="tableheader"><td>Original file/dir</td><td>Restored to</td></tr>
\$fileListStr
</table>
$Lang{Archive___num_details_for__host2 } = <<EOF;
\${h1("Archive #\$num Details for \$host")}
<p>
-<table border>
-<tr><td> Number </td><td> \$Archives[\$i]{num} </td></tr>
-<tr><td> Requested by </td><td> \$ArchiveReq{user} </td></tr>
-<tr><td> Request time </td><td> \$reqTime </td></tr>
-<tr><td> Result </td><td> \$Archives[\$i]{result} </td></tr>
-<tr><td> Error Message </td><td> \$Archives[\$i]{errorMsg} </td></tr>
-<tr><td> Start time </td><td> \$startTime </td></tr>
-<tr><td> Duration </td><td> \$duration min </td></tr>
-<tr><td> Xfer log file </td><td>
+<table class="tableStnd" border cellspacing="1" cellpadding="3" width="50%">
+<tr><td class="tableheader"> Number </td><td class="border"> \$Archives[\$i]{num} </td></tr>
+<tr><td class="tableheader"> Requested by </td><td class="border"> \$ArchiveReq{user} </td></tr>
+<tr><td class="tableheader"> Request time </td><td class="border"> \$reqTime </td></tr>
+<tr><td class="tableheader"> Result </td><td class="border"> \$Archives[\$i]{result} </td></tr>
+<tr><td class="tableheader"> Error Message </td><td class="border"> \$Archives[\$i]{errorMsg} </td></tr>
+<tr><td class="tableheader"> Start time </td><td class="border"> \$startTime </td></tr>
+<tr><td class="tableheader"> Duration </td><td class="border"> \$duration min </td></tr>
+<tr><td class="tableheader"> Xfer log file </td><td class="border">
<a href="\$MyURL?action=view&type=ArchiveLOG&num=\$Archives[\$i]{num}&host=\$host">View</a>,
<a href="\$MyURL?action=view&type=ArchiveErr&num=\$Archives[\$i]{num}&host=\$host">Errors</a>
</tr></tr>
<p>
\${h1("Host list")}
<p>
-<table border>
-<tr><td>Host</td><td>Backup Number</td></tr>
+<table class="tableStnd" border cellspacing="1" cellpadding="3" width="80%">
+<tr class="tableheader"><td>Host</td><td>Backup Number</td></tr>
\$HostListStr
</table>
EOF
start this request from the client machine itself.
EOF
-########################
-# ok you can do it then
-########################
+# ------------------------------------
+# !! Server Mesg !!
+# ------------------------------------
$Lang{Backup_requested_on_DHCP__host} = "Backup requested on DHCP \$host (\$In{hostIP}) by"
. " \$User from \$ENV{REMOTE_ADDR}";
-
$Lang{Backup_requested_on__host_by__User} = "Backup requested on \$host by \$User";
$Lang{Backup_stopped_dequeued_on__host_by__User} = "Backup stopped/dequeued on \$host by \$User";
-
$Lang{Restore_requested_to_host__hostDest__backup___num} = "Restore requested to host \$hostDest, backup #\$num,"
. " by \$User from \$ENV{REMOTE_ADDR}";
$Lang{Archive_requested} = "Archive requested by \$User from \$ENV{REMOTE_ADDR}";
$Lang{Backups_are_deferred_for_hours_hours_change_this_number} = <<EOF;
<li>Backups are deferred for \$hours hours
-(<a href=\"\$MyURL?action=Stop/Dequeue%20Backup&host=\$host\">change this number</a>).
+(<a href=\"\$MyURL?action=\${EscURI(\$Lang->{Stop_Dequeue_Archive})}&host=\$host\">change this number</a>).
EOF
$Lang{tryIP} = " and \$StatusHost{dhcpHostIP}";
\${h2("Restore Summary")}
<p>
Click on the restore number for more details.
-<table cellspacing="1" cellpadding="3" width="100%">
+<table class="tableStnd" border cellspacing="1" cellpadding="3" width="80%">
<tr class="tableheader"><td align="center"> Restore# </td>
<td align="center"> Result </td>
<td align="right"> Start Date</td>
\${h2("Archive Summary")}
<p>
Click on the archive number for more details.
-<table border>
-<tr><td align="center"> Archive# </td>
+<table class="tableStnd" border cellspacing="1" cellpadding="3" width="80%">
+<tr class="tableheader"><td align="center"> Archive# </td>
<td align="center"> Result </td>
<td align="right"> Start Date</td>
<td align="right"> Dur/mins</td>
$Lang{Status_link_pending} = "link pending";
$Lang{Status_link_running} = "link running";
-$Lang{Reason_backup_done} = "backup done";
-$Lang{Reason_restore_done} = "restore done";
-$Lang{Reason_nothing_to_do} = "nothing to do";
-$Lang{Reason_backup_failed} = "backup failed";
+$Lang{Reason_backup_done} = "backup done";
+$Lang{Reason_restore_done} = "restore done";
+$Lang{Reason_archive_done} = "archive done";
+$Lang{Reason_nothing_to_do} = "nothing to do";
+$Lang{Reason_backup_failed} = "backup failed";
$Lang{Reason_restore_failed} = "restore failed";
-$Lang{Reason_no_ping} = "no ping";
-$Lang{Reason_backup_canceled_by_user} = "backup canceled by user";
+$Lang{Reason_archive_failed} = "archive failed";
+$Lang{Reason_no_ping} = "no ping";
+$Lang{Reason_backup_canceled_by_user} = "backup canceled by user";
$Lang{Reason_restore_canceled_by_user} = "restore canceled by user";
+$Lang{Reason_archive_canceled_by_user} = "archive canceled by user";
# ---------
# Email messages
-#!/bin/perl -T
+#!/bin/perl
#my %lang;
# --------------------------------
+$Lang{Start_Archive} = "ENG Start Archive";
+$Lang{Stop_Dequeue_Archive} = "ENG Stop/Dequeue Archive";
$Lang{Start_Full_Backup} = "Comenzar copia de seguridad completa";
$Lang{Start_Incr_Backup} = "Comenzar copia de seguridad incremental";
$Lang{Stop_Dequeue_Backup} = "Parar/anular copia de seguridad";
$Lang{Restore} = "Restaurar";
+$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} = <<EOF;
+ENG
+\${h1(qq{$Lang{Admin_Options}})}
+<br>
+\${h1("Server Control")}
+<form action="\$MyURL" method="get">
+<table>
+ <tr><td>Stop the server:<td><input type="submit" name="action" value="Stop">
+ <tr><td>Reload the server configuration:<td><input type="submit" name="action" value="Reload">
+</table>
+</form>
+\${h1("Server Configuration")}
+<ul>
+ <li><i>Other options can go here... e.g.,</i>
+ <li>Edit server configuration
+</ul>
+EOF
+$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{Admin_Start_Server} = <<EOF;
+ENG\${h1(qq{$Lang{Unable_to_connect_to_BackupPC_server}})}
+<form action="\$MyURL" method="get">
+The BackupPC server at <tt>\$Conf{ServerHost}</tt> port <tt>\$Conf{ServerPort}</tt>
+is not currently running (maybe you just stopped it, or haven't yet started it).<br>
+Do you want to start it?
+<input type="hidden" name="action" value="startServer">
+<input type="submit" value="Start Server" name="ignore">
+</form>
+EOF
+
# -----
$Lang{H_BackupPC_Server_Status} = "Estado del Servidor BackupPC";
$Lang{BackupPC_Server_Status}= <<EOF;
\${h1(qq{$Lang{H_BackupPC_Server_Status}})}
-
<p>
\${h2(\"Información General del servidor\")}
<li> El PID del servidor es \$Info{pid}, en el host \$Conf{ServerHost},
version \$Info{Version}, iniciado el \$serverStartTime.
<li> Esta información de estado se ha generado el \$now.
+<li> ENG The configuration was last loaded at \$configLoadTime
<li> La cola de PC´s se activará de nuevo el \$nextWakeupTime.
<li> Información adicional:
<ul>
\${h2("Trabajos en Ejecución")}
<p>
-<table border>
-<tr><td> Host </td>
+<table class="tableStnd" border cellspacing="1" cellpadding="3">
+<tr class="tableheader"><td> Host </td>
<td> Tipo </td>
<td> Usuario </td>
<td> Hora de Inicio </td>
\${h2("Fallos que Precisan Atención")}
<p>
-<table border>
-<tr><td align="center"> Host </td>
+<table class="tableStnd" border cellspacing="1" cellpadding="3">
+<tr class="tableheader"><td align="center"> Host </td>
<td align="center"> Tipo </td>
<td align="center"> Usuario </td>
<td align="center"> Ultimo Intento </td>
# --------------------------------
$Lang{BackupPC__Server_Summary} = "BackupPC: Resumen del Servidor";
+$Lang{BackupPC__Archive} = "ENG BackupPC: Archive";
$Lang{BackupPC_Summary}=<<EOF;
\${h1(qq{$Lang{BackupPC__Server_Summary}})}
<p>
Este status ha sido generado el \$now.
-<p>
+</p>
\${h2("Hosts con Buenas Copias de Seguridad")}
<p>
<li> \$incrTot copias de seguridad incrementales con tamaño total de \${incrSizeTot} GB
(antes de agrupar y comprimir).
</ul>
-<table border>
-<tr><td> Host </td>
+</p>
+<table class="tableStnd" border cellpadding="3" cellspacing="1">
+<tr class="tableheader"><td> Host </td>
<td align="center"> Usuario </td>
<td align="center"> #Completo </td>
<td align="center"> Completo Antig./DÃas </td>
<td align="center"> Ultimo Intento </td></tr>
\$strGood
</table>
-<p>
-
+<br><br>
\${h2("Hosts Sin Copias de Seguridad")}
<p>
Hay \$hostCntNone hosts sin copias de seguridad.
<p>
-<table border>
-<tr><td> Host </td>
+<table class="tableStnd" border cellpadding="3" cellspacing="1">
+<tr class="tableheader"><td> Host </td>
<td align="center"> Usuario </td>
<td align="center"> #Completo </td>
<td align="center"> Completo Antig./DÃas </td>
</table>
EOF
+$Lang{BackupPC_Archive} = <<EOF;
+ENG\${h1(qq{$Lang{BackupPC__Archive}})}
+<script language="javascript" type="text/javascript">
+<!--
+
+ function checkAll(location)
+ {
+ for (var i=0;i<document.form1.elements.length;i++)
+ {
+ var e = document.form1.elements[i];
+ if ((e.checked || !e.checked) && e.name != \'all\') {
+ if (eval("document.form1."+location+".checked")) {
+ e.checked = true;
+ } else {
+ e.checked = false;
+ }
+ }
+ }
+ }
+
+ function toggleThis(checkbox)
+ {
+ var cb = eval("document.form1."+checkbox);
+ cb.checked = !cb.checked;
+ }
+
+//-->
+</script>
+
+There are \$hostCntGood hosts that have been backed up for a total size of \${fullSizeTot}GB
+<p>
+<form name="form1" method="post" action="\$MyURL">
+<input type="hidden" name="fcbMax" value="\$checkBoxCnt">
+<input type="hidden" name="type" value="1">
+<input type="hidden" name="host" value="\${EscHTML(\$archHost)}">
+<input type="hidden" name="action" value="Archive">
+<table class="tableStnd" border cellpadding="3" cellspacing="1">
+<tr class="tableheader"><td align=center> Host</td>
+ <td align="center"> User </td>
+ <td align="center"> Backup Size </td>
+\$strGood
+\$checkAllHosts
+</table>
+</form>
+<p>
+
+EOF
+
+$Lang{BackupPC_Archive2} = <<EOF;
+ENG\${h1(qq{$Lang{BackupPC__Archive}})}
+About to archive the following hosts
+<ul>
+\$HostListStr
+</ul>
+<form action="\$MyURL" method="post">
+\$hiddenStr
+<input type="hidden" name="action" value="Archive">
+<input type="hidden" name="host" value="\${EscHTML(\$archHost)}">
+<input type="hidden" name="type" value="2">
+<input type="hidden" value="0" name="archive_type">
+<table class="tableStnd" border cellspacing="1" cellpadding="3">
+\$paramStr
+<tr>
+ <td colspan=2><input type="submit" value="Start the Archive" name=""></td>
+</tr>
+</form>
+</table>
+EOF
+
+$Lang{BackupPC_Archive2_location} = <<EOF;
+ENG<tr>
+ <td>Archive Location/Device</td>
+ <td><input type="text" value="\$ArchiveDest" name="archive_device"></td>
+</tr>
+EOF
+
+$Lang{BackupPC_Archive2_compression} = <<EOF;
+ENG<tr>
+ <td>Compression</td>
+ <td>
+ <input type="radio" value="0" name="compression" \$ArchiveCompNone>None<br>
+ <input type="radio" value="1" name="compression" \$ArchiveCompGzip>gzip<br>
+ <input type="radio" value="2" name="compression" \$ArchiveCompBzip2>bzip2
+ </td>
+</tr>
+EOF
+
+$Lang{BackupPC_Archive2_parity} = <<EOF;
+ENG<tr>
+ <td>Number of Parity Files</td>
+ <td><input type="numeric" value="\$ArchivePar" name="par"></td>
+</tr>
+EOF
+
+$Lang{BackupPC_Archive2_split} = <<EOF;
+ENG<tr>
+ <td>Split output into</td>
+ <td><input type="numeric" value="\$ArchiveSplit" name="splitsize">Megabytes</td>
+</tr>
+EOF
+
# -----------------------------------
$Lang{Pool_Stat} = <<EOF;
<li>El grupo tiene \${poolSize}GB incluyendo \$info->{"\${name}FileCnt"} archivos
# --------------------------------
$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} = <<EOF;
\${h1("Resumen de la Cola de Copias de Seguridad")}
-<p>
+<br><br>
\${h2("Resumen de la Cola de Usuarios")}
<p>
Las siguientes solicitudes de usuarios están actualmente en cola:
-<table border>
-<tr><td> Host </td>
+</p>
+<table class="tableStnd" border cellspacing="1" cellpadding="3" width="80%">
+<tr class="tableheader"><td> Host </td>
<td> Hora Sol. </td>
<td> Usuario </td></tr>
\$strUser
</table>
-<p>
+<br><br>
\${h2("Resumen de Cola en Segundo Plano")}
<p>
Las siguientes solicitudes en segundo plano están actualmente en cola:
-<table border>
-<tr><td> Host </td>
+</p>
+<table class="tableStnd" border cellspacing="1" cellpadding="3" width="80%">
+<tr class="tableheader"><td> Host </td>
<td> Hora Sol. </td>
<td> Usuario </td></tr>
\$strBg
</table>
-<p>
-
+<br><br>
\${h2("Resumen de Cola de Comandos")}
<p>
Los siguientes comandos están actualmente en cola:
-<table border>
-<tr><td> Host </td>
+</p>
+<table class="tableStnd" border cellspacing="1" cellpadding="3" width="80%">
+<tr class="tableheader"><td> Host </td>
<td> Hora Sol. </td>
<td> Usuario </td>
<td> Comando </td></tr>
$Lang{Log_File_History__hdr} = <<EOF;
\${h1("Historial de Archivo de Registro \$hdr")}
<p>
-<table border>
-<tr><td align="center"> File </td>
+<table class="tableStnd" border cellspacing="1" cellpadding="3" width="80%">
+<tr class="tableheader"><td align="center"> File </td>
<td align="center"> Size </td>
<td align="center"> Hora Modificación </td></tr>
\$str
$Lang{Recent_Email_Summary} = <<EOF;
\${h1("Resumen de Mensajes Recientes (Orden de tiempo inverso)")}
<p>
-<table border>
-<tr><td align="center"> Destinatario </td>
+<table class="tableStnd" border cellspacing="1" cellpadding="3" width="80%">
+<tr class="tableheader"><td align="center"> Destinatario </td>
<td align="center"> Host </td>
<td align="center"> Hora </td>
<td align="center"> Asunto </td></tr>
# ------------------------------
$Lang{Restore_Options_for__host} = "BackupPC: Opciones de restauración para \$host";
$Lang{Restore_Options_for__host2} = <<EOF;
+\${h1("Opciones de restauración para \$host")}
<p>
Ha seleccionado los siguientes archivos/directorios de
la unidad \$share, copia número #\$num:
<ul>
\$fileListStr
</ul>
-<p>
+</p><p>
Tiene tres opciones para restaurar estos archivos/directorios.
Por favor, seleccione una de las siguientes opciones.
-<p>
+</p>
\${h2("Opción 1: Restauración Directa")}
<p>
+EOF
+
+$Lang{Restore_Options_for__host_Option1} = <<EOF;
Puede empezar un proceso que restaurará estos archivos directamente en
\$host.
-<p>
+</p><p>
<b>¡Atención!:</b> ¡Cualquier archivo existente con el mismo nombre que los que ha
seleccionado será sobreescrito!
-
-<form action="\$MyURL" method="post">
+</p>
+<form action="\$MyURL" method="post" name="direct">
<input type="hidden" name="host" value="\${EscHTML(\$host)}">
<input type="hidden" name="num" value="\$num">
<input type="hidden" name="type" value="3">
<table border="0">
<tr>
<td>Restaurar los archivos al host</td>
- <td><input type="text" size="40" value="\${EscHTML(\$host)}"
- name="hostDest"></td>
+ <td><!--<input type="text" size="40" value="\${EscHTML(\$host)}"
+ name="hostDest">-->
+ <select name="hostDest" onChange="document.direct.shareDest.value=''">
+ \$hostDestSel
+ </select>
+ <script language="Javascript">
+ function myOpen(URL) {
+ window.open(URL,'','width=500,height=400');
+ }
+ </script>
+ <a href="javascript:myOpen('\$MyURL?action=findShares&host='+document.direct.hostDest.options.value)">Search for available shares (NOT IMPLEMENTED)</a></td>
</tr><tr>
<td>Restaurar los archivos a la unidad</td>
<td><input type="text" size="40" value="\${EscHTML(\$share)}"
</form>
EOF
+$Lang{Restore_Options_for__host_Option1_disabled} = <<EOF;
+ENG Direct restore has been disabled for host \${EscHTML(\$hostDest)}.
+Please select one of the other restore options.
+EOF
+
# ------------------------------
$Lang{Option_2__Download_Zip_archive} = <<EOF;
-
+<p>
\${h2("Opción 2: Descargar archivo Zip")}
<p>
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.
-<p>
+</p><p>
<b>¡Atención!:</b> 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.
-<p>
+</p>
<form action="\$MyURL" method="post">
<input type="hidden" name="host" value="\${EscHTML(\$host)}">
<input type="hidden" name="num" value="\$num">
# ------------------------------
$Lang{Option_2__Download_Zip_archive2} = <<EOF;
+<p>
\${h2("Opción 2: Descargar archivo Zip")}
<p>
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
<a href="http://www.cpan.org">www.cpan.org</a>.
-<p>
+</p>
EOF
Puede descargar un archivo comprimido (.Tar) conteniendo todos los archivos y
directorios que ha seleccionado. Después puede hacer uso de una aplicación
local, como Tar o WinZip,para ver o extraer cualquiera de los archivos.
-<p>
+</p><p>
<b>¡Atención!:</b> 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.
-<p>
+</p>
<form action="\$MyURL" method="post">
<input type="hidden" name="host" value="\${EscHTML(\$host)}">
<input type="hidden" name="num" value="\$num">
<p>
La respuesta del servidor fué: \$reply
<p>
-Go back to <a href="\$MyURL?host=\$hostDest">\$hostDest home page</a>.
+ENG Go back to <a href="\$MyURL?host=\$hostDest">\$hostDest home page</a>.
+EOF
+
+$Lang{BackupPC_Archive_Reply_from_server} = <<EOF;
+ENG\${h1(\$str)}
+<p>
+Reply from server was: \$reply
EOF
# -------------------------
<ul>
\$statusStr
</ul>
-
+</p>
\${h2("Acciones del Usuario")}
<p>
<form action="\$MyURL" method="get">
<input type="submit" value="$Lang{Start_Full_Backup}" name="action">
<input type="submit" value="$Lang{Stop_Dequeue_Backup}" name="action">
</form>
-
+</p>
\${h2("Resumen de Copia de Seguridad")}
<p>
Haga click en el número de copia de seguridad para revisar y restaurar archivos.
-<table border>
-<tr><td align="center"> Copia Nº </td>
+</p>
+<table class="tableStnd" border cellspacing="1" cellpadding="3">
+<tr class="tableheader"><td align="center"> Copia Nº </td>
<td align="center"> Tipo </td>
<td align="center"> Completo </td>
<td align="center"> Fecha Inicio </td>
<p>
\$restoreStr
-
+</p>
+<br><br>
\${h2("Resumen de Errores de Transferencia")}
-<p>
-<table border>
-<tr><td align="center"> Copia Nº </td>
+<br><br>
+<table class="tableStnd" border cellspacing="1" cellpadding="3" width="80%">
+<tr class="tableheader"><td align="center"> Copia Nº </td>
<td align="center"> Tipo </td>
<td align="center"> Ver </td>
<td align="center"> Nº Xfer errs </td>
</tr>
\$errStr
</table>
-<p>
+<br><br>
\${h2("Resumen de Total/Tamaño de Archivos Reutilizados")}
<p>
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.
-<table border>
-<tr><td colspan="2"></td>
+</p>
+<table class="tableStnd" border cellspacing="1" cellpadding="3" width="80%">
+<tr class="tableheader"><td colspan="2" bgcolor="#ffffff"></td>
<td align="center" colspan="3"> Totales </td>
<td align="center" colspan="2"> Archivos Existentes </td>
<td align="center" colspan="2"> Archivos Nuevos </td>
</tr>
-<tr>
+<tr class="tableheader">
<td align="center"> Copia Nº </td>
<td align="center"> Tipo </td>
<td align="center"> Nº Archivos </td>
</tr>
\$sizeStr
</table>
-<p>
+<br><br>
\${h2("Resumen de Compresión")}
<p>
Efectividad de compresión para los archivos ya existentes en el lote y los
archivos nuevos comprimidos.
-<table border>
-<tr><td colspan="3"></td>
+</p>
+<table class="tableStnd" border cellspacing="1" cellpadding="3" width="80%">
+<tr class="tableheader"><td colspan="3" bgcolor="#ffffff"></td>
<td align="center" colspan="3"> Archivos Existentes </td>
<td align="center" colspan="3"> Archivos Nuevos </td>
</tr>
-<tr><td align="center"> Copia Nº </td>
+<tr class="tableheader"><td align="center"> Copia Nº </td>
<td align="center"> Tipo </td>
<td align="center"> Nivel Comp </td>
<td align="center"> Tamaño/MB </td>
</tr>
\$compStr
</table>
+<br><br>
+EOF
+
+$Lang{Host__host_Archive_Summary} = "BackupPC: Host \$host Archive Summary";
+$Lang{Host__host_Archive_Summary2} = <<EOF;
+ENG\${h1("Host \$host Archive Summary")}
<p>
+\$warnStr
+<ul>
+\$statusStr
+</ul>
+
+\${h2("User Actions")}
+<p>
+<form action="\$MyURL" method="get">
+<input type="hidden" name="archivehost" value="\$host">
+<input type="hidden" name="host" value="\$host">
+<input type="submit" value="$Lang{Start_Archive}" name="action">
+<input type="submit" value="$Lang{Stop_Dequeue_Archive}" name="action">
+</form>
+
+\$ArchiveStr
+
EOF
# -------------------------
<li> Está revisando la copia de seguridad Nº\$num, que comenzó hacia las \$backupTime
(hace \$backupAge dias),
\$filledBackup
+<li> ENG Enter directory: <input type="text" name="dir" size="50" maxlength="4096" value="\${EscHTML(\$dir)}"> <input type="submit" value="\$Lang->{Go}" name="Submit">
<li> Haga click en uno de los directorios de abajo para revisar sus contenidos,
<li> Haga click en un archivo para restaurarlo,
-<li> (ENGLISH)You can view the backup <a href="\$MyURL?action=dirHistory&host=\${EscURI(\$host)}&share=\$shareURI&dir=\$pathURI">history</a> of the current directory.
-<li> (ENGLISH)Enter directory: <input type="text" name="dir" size="50" maxlength="4096" value="\${EscHTML(\$dir)}"> <input type="submit" value="\$Lang->{Go}" name="Submit">
+<li> ENG You can view the backup <a href="\$MyURL?action=dirHistory&host=\${EscURI(\$host)}&share=\$shareURI&dir=\$pathURI">history</a> of the current directory.
</ul>
</form>
<input type="hidden" name="fcbMax" value="\$checkBoxCnt">
<input type="hidden" name="action" value="$Lang{Restore}">
<br>
-<table>
+<table width="100%">
<tr><td valign="top">
- <!--Navigate here:-->
<br><table align="center" border="0" cellpadding="0" cellspacing="0" bgcolor="#ffffff">
\$dirStr
</table>
</td><td width="3%">
</td><td valign="top">
- <!--Restore files here:-->
<br>
- <table cellpadding="0" cellspacing="0" bgcolor="#333333"><tr><td>
- <table border="0" width="100%" align="left" cellpadding="2" cellspacing="1">
+ <table border="0" width="100%" align="left" cellpadding="3" cellspacing="1">
\$fileHeader
\$topCheckAll
\$fileStr
This is now in the checkAll row
<input type="submit" name="Submit" value="Restore selected files">
-->
-</td></tr></table>
</form>
EOF
# 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} = <<EOF;
-\${h1("Directory backup history for \$host")}
-(ENGLISH)
+ENG\${h1("Directory backup history for \$host")}
<p>
This display shows each unique version of files across all
the backups:
\${h2("History of \${EscHTML(\$dirDisplay)}")}
<br>
-<table border bgcolor="#ffffcc">
-<tr bgcolor="\$Conf{CgiHeaderBgColor}"><td>Backup number</td>\$backupNumStr</tr>
-<tr bgcolor="\$Conf{CgiHeaderBgColor}"><td>Backup time</td>\$backupTimeStr</tr>
+<table cellspacing="2" cellpadding="3">
+<tr class="fviewheader"><td>Backup number</td>\$backupNumStr</tr>
+<tr class="fviewheader"><td>Backup time</td>\$backupTimeStr</tr>
\$fileStr
</table>
EOF
$Lang{Restore___num_details_for__host2 } = <<EOF;
\${h1("Detalles de la restauración Nº\$num de \$host")}
<p>
-<table border>
-<tr><td> Número </td><td> \$Restores[\$i]{num} </td></tr>
-<tr><td> Solicitado por </td><td> \$RestoreReq{user} </td></tr>
-<tr><td> Hora Petición </td><td> \$reqTime </td></tr>
-<tr><td> Resultado </td><td> \$Restores[\$i]{result} </td></tr>
-<tr><td> Mensaje de Error </td><td> \$Restores[\$i]{errorMsg} </td></tr>
-<tr><td> Host Origen </td><td> \$RestoreReq{hostSrc} </td></tr>
-<tr><td> Nº copia origen </td><td> \$RestoreReq{num} </td></tr>
-<tr><td> Unidad origen </td><td> \$RestoreReq{shareSrc} </td></tr>
-<tr><td> Host destino </td><td> \$RestoreReq{hostDest} </td></tr>
-<tr><td> Unidad destino </td><td> \$RestoreReq{shareDest} </td></tr>
-<tr><td> Hora comienzo </td><td> \$startTime </td></tr>
-<tr><td> Duración </td><td> \$duration min </td></tr>
-<tr><td> Número de archivos </td><td> \$Restores[\$i]{nFiles} </td></tr>
-<tr><td> Tamaño total </td><td> \${MB} MB </td></tr>
-<tr><td> Tasa de transferencia </td><td> \$MBperSec MB/sec </td></tr>
-<tr><td> Errores creación Tar </td><td> \$Restores[\$i]{tarCreateErrs} </td></tr>
-<tr><td> Errores de transferencia </td><td> \$Restores[\$i]{xferErrs} </td></tr>
-<tr><td> Archivo registro de transferencia </td><td>
+<table class="tableStnd" border cellspacing="1" cellpadding="3" width="50%">
+<tr><td class="tableheader"> Número </td><td class="border"> \$Restores[\$i]{num} </td></tr>
+<tr><td class="tableheader"> Solicitado por </td><td class="border"> \$RestoreReq{user} </td></tr>
+<tr><td class="tableheader"> Hora Petición </td><td class="border"> \$reqTime </td></tr>
+<tr><td class="tableheader"> Resultado </td><td class="border"> \$Restores[\$i]{result} </td></tr>
+<tr><td class="tableheader"> Mensaje de Error </td><td class="border"> \$Restores[\$i]{errorMsg} </td></tr>
+<tr><td class="tableheader"> Host Origen </td><td class="border"> \$RestoreReq{hostSrc} </td></tr>
+<tr><td class="tableheader"> Nº copia origen </td><td class="border"> \$RestoreReq{num} </td></tr>
+<tr><td class="tableheader"> Unidad origen </td><td class="border"> \$RestoreReq{shareSrc} </td></tr>
+<tr><td class="tableheader"> Host destino </td><td class="border"> \$RestoreReq{hostDest} </td></tr>
+<tr><td class="tableheader"> Unidad destino </td><td class="border"> \$RestoreReq{shareDest} </td></tr>
+<tr><td class="tableheader"> Hora comienzo </td><td class="border"> \$startTime </td></tr>
+<tr><td class="tableheader"> Duración </td><td class="border"> \$duration min </td></tr>
+<tr><td class="tableheader"> Número de archivos </td><td class="border"> \$Restores[\$i]{nFiles} </td></tr>
+<tr><td class="tableheader"> Tamaño total </td><td class="border"> \${MB} MB </td></tr>
+<tr><td class="tableheader"> Tasa de transferencia </td><td class="border"> \$MBperSec MB/sec </td></tr>
+<tr><td class="tableheader"> Errores creación Tar </td><td class="border"> \$Restores[\$i]{tarCreateErrs} </td></tr>
+<tr><td class="tableheader"> Errores de transferencia </td><td class="border"> \$Restores[\$i]{xferErrs} </td></tr>
+<tr><td class="tableheader"> Archivo registro de transferencia </td><td class="border">
<a href="\$MyURL?action=view&type=RestoreLOG&num=\$Restores[\$i]{num}&host=\$host">View</a>,
<a href="\$MyURL?action=view&type=RestoreErr&num=\$Restores[\$i]{num}&host=\$host">Errors</a>
</tr></tr>
</table>
-<p>
+</p>
\${h1("Lista de Archivos/Directorios")}
<p>
-<table border>
-<tr><td>Dir/archivo original</td><td>Restaurado a</td></tr>
+<table class="tableStnd" border cellspacing="1" cellpadding="3" width="100%">
+<tr class="tableheader"><td>Dir/archivo original</td><td>Restaurado a</td></tr>
\$fileListStr
</table>
EOF
+# ------------------------------
+$Lang{Archive___num_details_for__host} = "ENG BackupPC: Archive #\$num details for \$host";
+
+$Lang{Archive___num_details_for__host2 } = <<EOF;
+ENG\${h1("Archive #\$num Details for \$host")}
+<p>
+<table class="tableStnd" border cellspacing="1" cellpadding="3" width="50%">
+<tr><td class="tableheader"> Number </td><td class="border"> \$Archives[\$i]{num} </td></tr>
+<tr><td class="tableheader"> Requested by </td><td class="border"> \$ArchiveReq{user} </td></tr>
+<tr><td class="tableheader"> Request time </td><td class="border"> \$reqTime </td></tr>
+<tr><td class="tableheader"> Result </td><td class="border"> \$Archives[\$i]{result} </td></tr>
+<tr><td class="tableheader"> Error Message </td><td class="border"> \$Archives[\$i]{errorMsg} </td></tr>
+<tr><td class="tableheader"> Start time </td><td class="border"> \$startTime </td></tr>
+<tr><td class="tableheader"> Duration </td><td class="border"> \$duration min </td></tr>
+<tr><td class="tableheader"> Xfer log file </td><td class="border">
+<a href="\$MyURL?action=view&type=ArchiveLOG&num=\$Archives[\$i]{num}&host=\$host">View</a>,
+<a href="\$MyURL?action=view&type=ArchiveErr&num=\$Archives[\$i]{num}&host=\$host">Errors</a>
+</tr></tr>
+</table>
+<p>
+\${h1("Host list")}
+<p>
+<table class="tableStnd" border cellspacing="1" cellpadding="3" width="80%">
+<tr class="tableheader"><td>Host</td><td>Backup Number</td></tr>
+\$HostListStr
+</table>
+EOF
+
# -----------------------------------
$Lang{Email_Summary} = "BackupPC: Resumen de Correos";
$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)}.";
$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"
$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} = <<EOF;
\$host es un host DHCP y yo no conozco su dirección IP. He comprobado el
comenzar este proceso desde la propia máquina cliente.
EOF
-########################
-# ok you can do it then
-########################
+# ------------------------------------
+# !! Server Mesg !!
+# ------------------------------------
$Lang{Backup_requested_on_DHCP__host} = "Copia de seguridad solicitada en DHCP \$host (\$In{hostIP}) por"
. " \$User desde \$ENV{REMOTE_ADDR}";
-
$Lang{Backup_requested_on__host_by__User} = "Copia de seguridad solicitada en \$host por \$User";
$Lang{Backup_stopped_dequeued_on__host_by__User} = "Copia de seguridad detenida/desprogramada en \$host por \$User";
-
$Lang{Restore_requested_to_host__hostDest__backup___num} = "Restauración solicitada para el host \$hostDest, copia de seguridad #\$num,"
. " por \$User desde \$ENV{REMOTE_ADDR}";
+$Lang{Archive_requested} = "ENG Archive requested by \$User from \$ENV{REMOTE_ADDR}";
# -------------------------------------------------
# ------- Stuff that was forgotten ----------------
$Lang{Status} = "Estado";
$Lang{PC_Summary} = "Resumen PC";
$Lang{LOG_file} = "Archivo Registro";
+$Lang{LOG_files} = "ENG LOG files";
$Lang{Old_LOGs} = "Registros antiguos";
$Lang{Email_summary} = "Resumen correo";
$Lang{Config_file} = "Archivo configuración";
$Lang{Go} = "Aceptar";
$Lang{Hosts} = "Hosts";
+$Lang{There_have_been_no_archives} = "<h2> ENG There have been no archives </h2>\n";
$Lang{This_PC_has_never_been_backed_up} = "<h2> !Nunca se ha hecho copia de seguridad de este PC! </h2>\n";
$Lang{This_PC_is_used_by} = "<li>This PC es utilizado por \${UserLink(\$user)}";
$Lang{Backups_are_deferred_for_hours_hours_change_this_number} = <<EOF;
<li>Las copias de seguridad se retrasarán durante \$hours hours
-(<a href=\"\$MyURL?action=Stop/Dequeue%20Backup&host=\$host\">Cambie este número</a>).
+(<a href=\"\$MyURL?action=\${EscURI(\$Lang->{Stop_Dequeue_Archive})}&host=\$host\">Cambie este número</a>).
EOF
$Lang{tryIP} = " y \$StatusHost{dhcpHostIP}";
-$Lang{Host_Inhost} = "Host \$In{host}";
+#$Lang{Host_Inhost} = "Host \$In{host}";
$Lang{checkAll} = <<EOF;
-<tr bgcolor="#ffffcc"><td>
+<tr><td class="fviewborder">
<input type="checkbox" name="allFiles" onClick="return checkAll('allFiles');"> Seleccionar todo
-</td><td colspan="5" align="center">
+</td><td colspan="5" align="center" class="fviewborder">
<input type="submit" name="Submit" value="Restaurar los archivos seleccionados">
</td></tr>
EOF
+$Lang{checkAllHosts} = <<EOF;
+<tr><td class="fviewborder">
+<input type="checkbox" name="allFiles" onClick="return checkAll('allFiles');"> ENG Select all
+</td><td colspan="2" align="center" class="fviewborder">
+<input type="submit" name="Submit" value="ENG Archive selected hosts">
+</td></tr>
+EOF
+
$Lang{fileHeader} = <<EOF;
- <tr bgcolor="\$Conf{CgiHeaderBgColor}"><td align=center> Nombre</td>
+ <tr class="fviewheader"><td align=center> Nombre</td>
<td align="center"> Tipo</td>
<td align="center"> Modo</td>
<td align="center"> Nº</td>
EOF
$Lang{Home} = "Principal";
+$Lang{Browse} = "ENG Browse backups";
$Lang{Last_bad_XferLOG} = "Ultimo error en registro de transferencia";
$Lang{Last_bad_XferLOG_errors_only} = "Ultimo error en registro de transferencia (errores sólo)";
EOF
$Lang{Visit_this_directory_in_backup} = <<EOF;
-<li> Explorar este directorio en copia de seguridad Nº\$otherDirs.
+<li> ENG Select the backup you wish to view: <select onChange="window.location=this.value">\$otherDirs </select>
EOF
$Lang{Restore_Summary} = <<EOF;
\${h2("Resumen de Restauración")}
<p>
Haga click en el número de restauración para ver sus detalles.
-<table border>
-<tr><td align="center"> Restauración Nº </td>
+<table class="tableStnd" border cellspacing="1" cellpadding="3" width="80%">
+<tr class="tableheader"><td align="center"> Restauración Nº </td>
<td align="center"> Resultado </td>
<td align="right"> Fecha Inicio</td>
<td align="right"> Dur/mins</td>
<p>
EOF
+$Lang{Archive_Summary} = <<EOF;
+ENG\${h2("Archive Summary")}
+<p>
+Click on the archive number for more details.
+<table class="tableStnd" border cellspacing="1" cellpadding="3" width="80%">
+<tr class="tableheader"><td align="center"> Archive# </td>
+ <td align="center"> Result </td>
+ <td align="right"> Start Date</td>
+ <td align="right"> Dur/mins</td>
+</tr>
+\$ArchiveStr
+</table>
+<p>
+EOF
+
$Lang{BackupPC__Documentation} = "BackupPC: Documentacion";
$Lang{No} = "no";
$Lang{backupType_full} = "completo";
$Lang{backupType_incr} = "incremental";
-$Lang{backupType_partial} = "(ENGLISH)partial";
+$Lang{backupType_partial} = "ENG partial";
$Lang{failed} = "fallido";
$Lang{success} = "éxito";
$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
-#!/bin/perl -T
+#!/bin/perl
#my %Lang;
#use strict;
\${h2("Travaux en cours d'exécution")}
<p>
-<table cellspacing="1" cellpadding="3">
+<table class="tableStnd" border cellspacing="1" cellpadding="3">
<tr class="tableheader"><td> Hôte </td>
<td> Type </td>
<td> Utilisateur </td>
\${h2("Échecs qui demandent de l'attention")}
<p>
-<table cellspacing="1" cellpadding="3">
+<table class="tableStnd" border cellspacing="1" cellpadding="3">
<tr class="tableheader"><td align="center"> Hôte </td>
<td align="center"> Type </td>
<td align="center"> Utilisateur </td>
\${h1(qq{$Lang{BackupPC__Server_Summary}})}
<p>
Ce statut a été généré le \$now.
-<p>
+</p>
\${h2("Hôtes avec de bonnes sauvegardes")}
<p>
<li> \$incrTot sauvegardes incrémentielles de tailles cumulées de \${incrSizeTot} Go
(précédant la mise en commun et la compression).
</ul>
-<table border>
-<tr><td> Hôte </td>
+</p>
+<table class="tableStnd" border cellpadding="3" cellspacing="1">
+<tr class="tableheader"><td> Hôte </td>
<td align="center"> Utilisateur </td>
<td align="center"> Nb complètes </td>
<td align="center"> Complètes Âge/Jours </td>
<td align="center"> Dernière tentative </td></tr>
\$strGood
</table>
-<p>
-
+<br><br>
\${h2("Hôtes sans sauvegardes")}
<p>
Il y a \$hostCntNone hôtes sans sauvegardes.
<p>
-<table border>
-<tr><td> Hôte </td>
+<table class="tableStnd" border cellpadding="3" cellspacing="1">
+<tr class="tableheader"><td> Hôte </td>
<td align="center"> Utilisateur </td>
<td align="center"> Nb complètes </td>
<td align="center"> Complètes Âge/jour </td>
EOF
$Lang{BackupPC_Archive}=<<EOF;
-
\${h1(qq{$Lang{BackupPC__Archive}})}
<script language="javascript" type="text/javascript">
<!--
<form name="form1" method="post" action="\$MyURL">
<input type="hidden" name="fcbMax" value="\$checkBoxCnt">
<input type="hidden" name="type" value="1">
+<input type="hidden" name="host" value="\${EscHTML(\$archHost)}">
<input type="hidden" name="action" value="Archive">
-<table cellpadding="3" cellspacing="1">
+<table class="tableStnd" border cellpadding="3" cellspacing="1">
<tr class="tableheader"><td align=center> Host</td>
<td align="center"> Usager </td>
<td align="center"> Taille </td>
\$strGood
\$checkAllHosts
-</form>
</table>
+</form>
<p>
-</table>
EOF
$Lang{BackupPC_Archive2}=<<EOF;
-\${h1(qq{$Lang{BackupPC__Archive}})} (ENGLISH)
+\${h1(qq{$Lang{BackupPC__Archive}})}
Prêt à démarrer l'archivage des hôtes suivants
<ul>
\$HostListStr
<form action="\$MyURL" method="post">
\$hiddenStr
<input type="hidden" name="action" value="Archive">
+<input type="hidden" name="host" value="\${EscHTML(\$archHost)}">
<input type="hidden" name="type" value="2">
<input type="hidden" value="0" name="archive_type">
-<table border="1">
+<table class="tableStnd" border cellspacing="1" cellpadding="3">
+\$paramStr
+<tr>
+ <td colspan=2><input type="submit" value="Démarrer l'archivage" name=""></td>
+</tr>
+</form>
+</table>
+EOF
+
+$Lang{BackupPC_Archive2_location} = <<EOF;
<tr>
- <td>Archive Location/Device</td>
+ <td>ENG Archive Location/Device</td>
<td><input type="text" value="\$ArchiveDest" name="archive_device"></td>
+</tr>
+EOF
+
+$Lang{BackupPC_Archive2_compression} = <<EOF;
<tr>
<td>Compression</td>
- <td><input type="radio" value="0" name="compression" \$ArchiveCompNone>Aucune<br>
+ <td>
+ <input type="radio" value="0" name="compression" \$ArchiveCompNone>Aucune<br>
<input type="radio" value="1" name="compression" \$ArchiveCompGzip>gzip<br>
- <input type="radio" value="2" name="compression" \$ArchiveCompBzip2>bzip2</tr>
+ <input type="radio" value="2" name="compression" \$ArchiveCompBzip2>bzip2
+ </td>
</tr>
+EOF
+
+$Lang{BackupPC_Archive2_parity} = <<EOF;
<tr>
<td>Nombre de fichiers de parité</td>
<td><input type="numeric" value="\$ArchivePar" name="par"></td>
</tr>
+EOF
+
+$Lang{BackupPC_Archive2_split} = <<EOF;
<tr>
- <td>Scinder le fichier en fichiers de: </td>
+ <td>Scinder le fichier en fichiers de</td>
<td><input type="numeric" value="\$ArchiveSplit" name="splitsize">Mega octets</td>
</tr>
-<tr>
- <td colspan=2><input type="submit" value="Démarrer l'archivage" name=""></td>
-</tr>
-</form>
-</table>
EOF
# -----------------------------------
$Lang{Are_you_sure_start} = <<EOF;
\${h1("Êtes vous certain ?")}
<p>
-Vous allez bientôt démarrer une sauvegarde <i>\$type</i> depuis \$host.
+Vous allez bientôt démarrer une sauvegarde \$type depuis \$host.
<form action="\$MyURL" method="get">
<input type="hidden" name="host" value="\$host">
<p>
Les demandes utilisateurs suivantes sont actuellement en attente :
</p>
-<table cellspacing="1" cellpadding="3" width="80%">
+<table class="tableStnd" border cellspacing="1" cellpadding="3" width="80%">
<tr class="tableheader"><td> Hôte </td>
<td> Temps Requis </td>
<td> Utilisateur </td></tr>
<p>
Les demandes en arrière plan suivantes sont actuellement en attente :
</p>
-<table cellspacing="1" cellpadding="3" width="80%">
+<table class="tableStnd" border cellspacing="1" cellpadding="3" width="80%">
<tr class="tableheader"><td> Hôte </td>
<td> Temps requis </td>
<td> Utilisateur </td></tr>
<p>
Les demandes de commande suivantes sont actuellement en attente :
</p>
-<table cellspacing="1" cellpadding="3" width="80%">
+<table class="tableStnd" border cellspacing="1" cellpadding="3" width="80%">
<tr class="tableheader"><td> Hôtes </td>
<td> Temps Requis </td>
<td> Utilisateur </td>
$Lang{Log_File_History__hdr} = <<EOF;
\${h1("Historique du fichier journal \$hdr")}
<p>
-<table border>
-<tr><td align="center"> Fichier </td>
+<table class="tableStnd" border cellspacing="1" cellpadding="3" width="80%">
+<tr class="tableheader"><td align="center"> Fichier </td>
<td align="center"> Taille </td>
<td align="center"> Date de modification </td></tr>
\$str
$Lang{Recent_Email_Summary} = <<EOF;
\${h1("Résumé des courriels récents (Du plus récent au plus vieux)")}
<p>
-<table border>
-<tr><td align="center"> Destinataire </td>
+<table class="tableStnd" border cellspacing="1" cellpadding="3" width="80%">
+<tr class="tableheader"><td align="center"> Destinataire </td>
<td align="center"> Hôte </td>
<td align="center"> Date </td>
<td align="center"> Sujet </td></tr>
<ul>
\$fileListStr
</ul>
-<p>
+</p><p>
Vous avez trois choix pour restaurer ces fichiers/repertoires.
Veuillez sélectionner une des options suivantes.
-<p>
+</p>
\${h2("Option 1: Restauration directe")}
<p>
+EOF
+
+$Lang{Restore_Options_for__host_Option1} = <<EOF;
Vous pouvez démarrer une restauration de ces fichiers
directement sur \$host.
-<p>
+</p><p>
<b>Attention:</b>
tous les fichiers correspondant à ceux que vous avez sélectionnés vont être effacés !
-
-<form action="\$MyURL" method="post">
+</p>
+<form action="\$MyURL" method="post" name="direct">
<input type="hidden" name="host" value="\${EscHTML(\$host)}">
<input type="hidden" name="num" value="\$num">
<input type="hidden" name="type" value="3">
</form>
EOF
+$Lang{Restore_Options_for__host_Option1_disabled} = <<EOF;
+ENG Direct restore has been disabled for host \${EscHTML(\$hostDest)}.
+Please select one of the other restore options.
+EOF
# ------------------------------
$Lang{Option_2__Download_Zip_archive} = <<EOF;
-
+<p>
\${h2("Option 2: Télécharger une archive Zip")}
<p>
Vous pouvez télécharger une archive compressée (.zip) contenant tous les fichiers/répertoires que vous
avez sélectionnés. Vous pouvez utiliser une application locale, comme Winzip, pour voir ou extraire n\'importe quel fichier.
-<p>
+</p><p>
<b>Attention:</b> en fonction de quels fichiers/répertoires vous avez sélectionné,
cette archive peut devenir très très large. Cela peut prendre plusieurs minutes pour créer
et transférer cette archive, et vous aurez besoin d\'assez d\'espace disque pour le stocker.
-<p>
+</p>
<form action="\$MyURL" method="post">
<input type="hidden" name="host" value="\${EscHTML(\$host)}">
<input type="hidden" name="num" value="\$num">
# ------------------------------
$Lang{Option_2__Download_Zip_archive2} = <<EOF;
+<p>
\${h2("Option 2: Télécharger une archive Zip")}
<p>
Vous ne pouvez pas télécharger d'archive zip, car Archive::Zip n\'est pas
installé.
Veuillez demander à votre administrateur système d\'installer
Archive::Zip depuis <a href="http://www.cpan.org">www.cpan.org</a>.
-<p>
+</p>
EOF
Vous pouvez télécharger une archive Tar contenant tous les fichiers/répertoires
que vous avez sélectionnés. Vous pourrez alors utiliser une application locale,
comme tar ou winzip pour voir ou extraire n\'importe quel fichier.
-<p>
+</p><p>
<b>Attention:</b> en fonction des fichiers/répertoires que vous avez sélectionnés,
cette archive peut devenir très très large. Cela peut prendre plusieurs minutes
pour créer et transférer l\'archive, et vous aurez besoin d'assez
d\'espace disque local pour la stocker.
-<p>
+</p>
<form action="\$MyURL" method="post">
<input type="hidden" name="host" value="\${EscHTML(\$host)}">
<input type="hidden" name="num" value="\$num">
<p>
Cliquer sur le numéro de l\'archive pour naviguer et restaurer les fichiers de sauvegarde.
</p>
-<table cellspacing="1" cellpadding="3" width="100%">
+<table class="tableStnd" border cellspacing="1" cellpadding="3">
<tr class="tableheader"><td align="center"> Sauvegarde n° </td>
<td align="center"> Type </td>
<td align="center"> Fusionnée </td>
<br><br>
\${h2("Résumé des erreurs de transfert")}
<br><br>
-<table cellspacing="1" cellpadding="3" width="100%">
+<table class="tableStnd" border cellspacing="1" cellpadding="3" width="80%">
<tr class="tableheader"><td align="center"> Nb sauvegarde </td>
<td align="center"> Type </td>
<td align="center"> Voir </td>
Les nouveaux fichiers sont ceux qui ont été ajoutés au serveur.
Les fichiers vides et les erreurs de SMB ne sont pas comptabilisés parmis les nouveaux et les réutilisés.
</p>
-<table cellspacing="1" cellpadding="3" width="100%">
+<table class="tableStnd" border cellspacing="1" cellpadding="3" width="80%">
<tr class="tableheader"><td colspan="2" bgcolor="#ffffff"></td>
<td align="center" colspan="3"> Totaux </td>
<td align="center" colspan="2"> Fichiers existants </td>
Performance de la compression pour les fichiers déjà sur le serveur et
récemment compressés.
</p>
-<table cellspacing="1" cellpadding="3" width="100%">
+<table class="tableStnd" border cellspacing="1" cellpadding="3" width="80%">
<tr class="tableheader"><td colspan="3" bgcolor="#ffffff"></td>
<td align="center" colspan="3"> Fichiers existants </td>
<td align="center" colspan="3"> Nouveaux fichiers </td>
<li> Vous naviguez dans la sauvegarde n°\$num, qui a commencé vers \$backupTime
(il y a \$backupAge jours),
\$filledBackup
+<li> Entrez le répertoire: <input type="text" name="dir" size="50" maxlength="4096" value="\${EscHTML(\$dir)}"> <input type="submit" value="\$Lang->{Go}" name="Submit">
<li> Cliquer dans un répertoire ci-dessous pour y naviguer,
<li> Cliquer dans un fichier ci-dessous pour le restaurer,
<li> Vous pouvez l'<a href="\$MyURL?action=dirHistory&host=\${EscURI(\$host)}&share=\$shareURI&dir=\$pathURI">historique</a> de sauvegarde du répertoire courant.
-<li> Entrez le répertoire: <input type="text" name="dir" size="50" maxlength="4096" value="\${EscHTML(\$dir)}"> <input type="submit" value="\$Lang->{Go}" name="Submit">
</ul>
</form>
$Lang{DirHistory_for__host} = <<EOF;
\${h1("Historique des sauvegardes de répertoires pour \$host")}
-
<p>
Cette page montre chaque version des fichiers parmis toutes sauvegardes:
<ul>
<br>
<table cellspacing="2" cellpadding="3">
-<tr bgcolor="\$Conf{CgiHeaderBgColor}"><td>Numéro de sauvegarde</td>\$backupNumStr</tr>
-<tr bgcolor="\$Conf{CgiHeaderBgColor}"><td>Date</td>\$backupTimeStr</tr>
+<tr class="fviewheader"><td>Numéro de sauvegarde</td>\$backupNumStr</tr>
+<tr class="fviewheader"><td>Date</td>\$backupTimeStr</tr>
\$fileStr
</table>
EOF
$Lang{Restore___num_details_for__host2 } = <<EOF;
\${h1("Détails de la restauration n° \$num pour \$host")}
<p>
-<table cellspacing="1" cellpadding="3" width="50%">
-<tr><td class="tableheader"> Numéro </td><td> \$Restores[\$i]{num} </td></tr>
-<tr><td class="tableheader"> Demandée par </td><td> \$RestoreReq{user} </td></tr>
-<tr><td class="tableheader"> Demandée à </td><td> \$reqTime </td></tr>
-<tr><td class="tableheader"> Résultat </td><td> \$Restores[\$i]{result} </td></tr>
-<tr><td class="tableheader"> Message d'erreur </td><td> \$Restores[\$i]{errorMsg} </td></tr>
-<tr><td class="tableheader"> Hôte source </td><td> \$RestoreReq{hostSrc} </td></tr>
-<tr><td class="tableheader"> N° de sauvegarde </td><td> \$RestoreReq{num} </td></tr>
-<tr><td class="tableheader"> Partition source </td><td> \$RestoreReq{shareSrc} </td></tr>
-<tr><td class="tableheader"> Hôte de destination </td><td> \$RestoreReq{hostDest} </td></tr>
-<tr><td class="tableheader"> Partition de destination </td><td> \$RestoreReq{shareDest} </td></tr>
-<tr><td class="tableheader"> Début </td><td> \$startTime </td></tr>
-<tr><td class="tableheader"> Durée </td><td> \$duration min </td></tr>
-<tr><td class="tableheader"> Nombre de fichier </td><td> \$Restores[\$i]{nFiles} </td></tr>
-<tr><td class="tableheader"> Grosseur totale </td><td> \${MB} Mo </td></tr>
-<tr><td class="tableheader"> Taux de transfert </td><td> \$MBperSec Mo/sec </td></tr>
-<tr><td class="tableheader"> Erreurs de TarCreate </td><td> \$Restores[\$i]{tarCreateErrs} </td></tr>
-<tr><td class="tableheader"> Erreurs de transfert </td><td> \$Restores[\$i]{xferErrs} </td></tr>
-<tr><td class="tableheader"> Journal de transfert </td><td>
+<table class="tableStnd" border cellspacing="1" cellpadding="3" width="50%">
+<tr><td class="tableheader"> Numéro </td><td class="border"> \$Restores[\$i]{num} </td></tr>
+<tr><td class="tableheader"> Demandée par </td><td class="border"> \$RestoreReq{user} </td></tr>
+<tr><td class="tableheader"> Demandée à </td><td class="border"> \$reqTime </td></tr>
+<tr><td class="tableheader"> Résultat </td><td class="border"> \$Restores[\$i]{result} </td></tr>
+<tr><td class="tableheader"> Message d'erreur </td><td class="border"> \$Restores[\$i]{errorMsg} </td></tr>
+<tr><td class="tableheader"> Hôte source </td><td class="border"> \$RestoreReq{hostSrc} </td></tr>
+<tr><td class="tableheader"> N° de sauvegarde </td><td class="border"> \$RestoreReq{num} </td></tr>
+<tr><td class="tableheader"> Partition source </td><td class="border"> \$RestoreReq{shareSrc} </td></tr>
+<tr><td class="tableheader"> Hôte de destination </td><td class="border"> \$RestoreReq{hostDest} </td></tr>
+<tr><td class="tableheader"> Partition de destination </td><td class="border"> \$RestoreReq{shareDest} </td></tr>
+<tr><td class="tableheader"> Début </td><td class="border"> \$startTime </td></tr>
+<tr><td class="tableheader"> Durée </td><td class="border"> \$duration min </td></tr>
+<tr><td class="tableheader"> Nombre de fichier </td><td class="border"> \$Restores[\$i]{nFiles} </td></tr>
+<tr><td class="tableheader"> Grosseur totale </td><td class="border"> \${MB} Mo </td></tr>
+<tr><td class="tableheader"> Taux de transfert </td><td class="border"> \$MBperSec Mo/sec </td></tr>
+<tr><td class="tableheader"> Erreurs de TarCreate </td><td class="border"> \$Restores[\$i]{tarCreateErrs} </td></tr>
+<tr><td class="tableheader"> Erreurs de transfert </td><td class="border"> \$Restores[\$i]{xferErrs} </td></tr>
+<tr><td class="tableheader"> Journal de transfert </td><td class="border">
<a href="\$MyURL?action=view&type=RestoreLOG&num=\$Restores[\$i]{num}&host=\$host">Visionner</a>,
<a href="\$MyURL?action=view&type=RestoreErr&num=\$Restores[\$i]{num}&host=\$host">Erreurs</a>
</tr></tr>
</table>
-<p>
+</p>
\${h1("Liste des Fichiers/Répertoires")}
<p>
-<table cellspacing="1" cellpadding="3" width="100%">
+<table class="tableStnd" border cellspacing="1" cellpadding="3" width="100%">
<tr class="tableheader"><td>Fichier/répertoire original</td><td>Restauré vers</td></tr>
\$fileListStr
</table>
$Lang{Archive___num_details_for__host2 } = <<EOF;
\${h1("Archive #\$num Details for \$host")}
<p>
-<table border>
-<tr><td> Numéro </td><td> \$Archives[\$i]{num} </td></tr>
-<tr><td> Demandé par </td><td> \$ArchiveReq{user} </td></tr>
-<tr><td> Heure de demande </td><td> \$reqTime </td></tr>
-<tr><td> Résultat </td><td> \$Archives[\$i]{result} </td></tr>
-<tr><td> Message d'erreur </td><td> \$Archives[\$i]{errorMsg} </td></tr>
-<tr><td> Heure de début </td><td> \$startTime </td></tr>
-<tr><td> Durée </td><td> \$duration min </td></tr>
-<tr><td> Journal de transfert </td><td>
+<table class="tableStnd" border cellspacing="1" cellpadding="3" width="50%">
+<tr><td class="tableheader"> Numéro </td><td class="border"> \$Archives[\$i]{num} </td></tr>
+<tr><td class="tableheader"> Demandé par </td><td class="border"> \$ArchiveReq{user} </td></tr>
+<tr><td class="tableheader"> Heure de demande </td><td class="border"> \$reqTime </td></tr>
+<tr><td class="tableheader"> Résultat </td><td class="border"> \$Archives[\$i]{result} </td></tr>
+<tr><td class="tableheader"> Message d'erreur </td><td class="border"> \$Archives[\$i]{errorMsg} </td></tr>
+<tr><td class="tableheader"> Heure de début </td><td class="border"> \$startTime </td></tr>
+<tr><td class="tableheader"> Durée </td><td class="border"> \$duration min </td></tr>
+<tr><td class="tableheader"> Journal de transfert </td><td class="border">
<a href="\$MyURL?action=view&type=ArchiveLOG&num=\$Archives[\$i]{num}&host=\$host">Voir</a>,
<a href="\$MyURL?action=view&type=ArchiveErr&num=\$Archives[\$i]{num}&host=\$host">Erreurs</a>
</tr></tr>
<p>
\${h1("Liste de hôtes")}
<p>
-<table border>
-<tr><td>Host</td><td>Numéro de sauvegarde</td></tr>
+<table class="tableStnd" border cellspacing="1" cellpadding="3" width="80%">
+<tr class="tableheader"><td>Host</td><td>Numéro de sauvegarde</td></tr>
\$HostListStr
</table>
EOF
$Lang{Backup_requested_on_DHCP__host} = "Demande de sauvegarde sur l\'hôte \$host (\$In{hostIP}) par"
. " \$User depuis \$ENV{REMOTE_ADDR}";
-
$Lang{Backup_requested_on__host_by__User} = "Sauvegarde demandée sur \$host par \$User";
$Lang{Backup_stopped_dequeued_on__host_by__User} = "Sauvegarde Arrêtée/déprogrammée pour \$host par \$User";
-
$Lang{Restore_requested_to_host__hostDest__backup___num} = "Restauration demandée pour l\'hôte \$hostDest, "
. "sauvegarde n° \$num, par \$User depuis \$ENV{REMOTE_ADDR}";
$Lang{Archive_requested} = "Archivage demandé par \$User de \$ENV{REMOTE_ADDR}";
$Lang{Backups_are_deferred_for_hours_hours_change_this_number} = <<EOF;
<li>Les sauvegardes sont reportées pour \$hours heures
-(<a href=\"\$MyURL?action=Stop/Dequeue%20Backup&host=\$host\">changer ce nombre</a>).
+(<a href=\"\$MyURL?action=\${EscURI(\$Lang->{Stop_Dequeue_Archive})}&host=\$host\">changer ce nombre</a>).
EOF
$Lang{tryIP} = " et \$StatusHost{dhcpHostIP}";
# $Lang{Host_Inhost} = "Hôte \$In{host}";
$Lang{checkAll} = <<EOF;
-<tr bgcolor="#ffffcc"><td>
+<tr><td class="fviewborder">
<input type="checkbox" name="allFiles" onClick="return checkAll('allFiles');"> Tout sélectionner
-</td><td colspan="5" align="center">
+</td><td colspan="5" align="center" class="fviewborder">
<input type="submit" name="Submit" value="Restaurer les fichiers sélectionnés">
</td></tr>
EOF
EOF
$Lang{fileHeader} = <<EOF;
- <tr bgcolor="\$Conf{CgiHeaderBgColor}"><td align=center> Nom</td>
+ <tr class="fviewheader"><td align=center> Nom</td>
<td align="center"> Type</td>
<td align="center"> Mode</td>
<td align="center"> n°</td>
EOF
$Lang{Visit_this_directory_in_backup} = <<EOF;
-<li> Explorer ce répertoire dans la sauvegarde no \$otherDirs.
+<li> ENG Select the backup you wish to view: <select onChange="window.location=this.value">\$otherDirs </select>
EOF
$Lang{Restore_Summary} = <<EOF;
\${h2("Résumé de la restauration")}
<p>
Cliquer sur le numéro de restauration pour plus de détails.
-<table cellspacing="1" cellpadding="3" width="100%">
+<table class="tableStnd" border cellspacing="1" cellpadding="3" width="80%">
<tr class="tableheader"><td align="center"> Sauvegarde n° </td>
<td align="center"> Résultat </td>
<td align="right"> Date de départ</td>
\${h2("Archive Summary")} (ENGLISH)
<p>
Click on the archive number for more details.
-<table border>
-<tr><td align="center"> Archive# </td>
+<table class="tableStnd" border cellspacing="1" cellpadding="3" width="80%">
+<tr class="tableheader"><td align="center"> Archive# </td>
<td align="center"> Result </td>
<td align="right"> Start Date</td>
<td align="right"> Dur/mins</td>
$Lang{Status_link_pending} = "en attente de l'édition de liens";
$Lang{Status_link_running} = "édition de liens en cours";
-$Lang{Reason_backup_done} = "sauvegarde terminée";
-$Lang{Reason_restore_done} = "restauration terminée";
-$Lang{Reason_nothing_to_do} = "rien à faire";
-$Lang{Reason_backup_failed} = "la sauvegarde a échouée";
+$Lang{Reason_backup_done} = "sauvegarde terminée";
+$Lang{Reason_restore_done} = "restauration terminée";
+$Lang{Reason_archive_done} = "ENG archive done";
+$Lang{Reason_nothing_to_do} = "rien à faire";
+$Lang{Reason_backup_failed} = "la sauvegarde a échouée";
$Lang{Reason_restore_failed} = "la restauration a échouée";
-$Lang{Reason_no_ping} = "pas de ping";
-$Lang{Reason_backup_canceled_by_user} = "sauvegarde annulée par l'utilisateur";
+$Lang{Reason_archive_failed} = "ENG archive failed";
+$Lang{Reason_no_ping} = "pas de ping";
+$Lang{Reason_backup_canceled_by_user} = "sauvegarde annulée par l'utilisateur";
$Lang{Reason_restore_canceled_by_user} = "restauration annulée par l'utilisateur";
+$Lang{Reason_archive_canceled_by_user} = "ENG archive canceled by user";
# ---------
# Email messages
#
#========================================================================
#
-# Version 2.1.0_CVS, released 3 Jul 2003.
+# Version 2.1.0_CVS, released 8 Feb 2004.
#
# See http://backuppc.sourceforge.net.
#
print(STDERR "cmdExecOrEval: about to exec ",
$bpc->execCmd2ShellCmd(@$cmd), "\n")
if ( $bpc->{verbose} );
- exec(map { m/(.*)/ } @$cmd); # untaint
+ alarm(0);
+ $cmd = [map { m/(.*)/ } @$cmd]; # untaint
+ #
+ # force list-form of exec(), ie: no shell even for 1 arg
+ #
+ exec { $cmd->[0] } @$cmd;
print(STDERR "Exec failed for @$cmd\n");
exit(1);
}
#
close(STDERR);
open(STDERR, ">&STDOUT");
- exec(map { m/(.*)/ } @$cmd); # untaint
+ alarm(0);
+ $cmd = [map { m/(.*)/ } @$cmd]; # untaint
+ #
+ # force list-form of exec(), ie: no shell even for 1 arg
+ #
+ exec { $cmd->[0] } @$cmd;
print("Exec of @$cmd failed\n");
exit(1);
}
#
#========================================================================
#
-# Version 2.1.0_CVS, released 3 Jul 2003.
+# Version 2.1.0_CVS, released 8 Feb 2004.
#
# See http://backuppc.sourceforge.net.
#
--- /dev/null
+#============================================================= -*-perl-*-
+#
+# BackupPC::RsyncDigest package
+#
+# DESCRIPTION
+#
+# This library defines a BackupPC::RsyncDigest class for computing
+# and caching rsync checksums.
+#
+# AUTHOR
+# Craig Barratt <cbarratt@users.sourceforge.net>
+#
+# 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.
+#
+#========================================================================
+
+package BackupPC::RsyncDigest;
+
+use strict;
+
+use vars qw( $RsyncLibOK );
+use Carp;
+
+BEGIN {
+ eval "use File::RsyncP;";
+ if ( $@ ) {
+ #
+ # File::RsyncP doesn't exist. Define some dummy constant
+ # subs so that the code below doesn't barf.
+ #
+ $RsyncLibOK = 0;
+ } else {
+ $RsyncLibOK = 1;
+ }
+};
+
+#
+# Return the rsync block size based on the file size.
+# We also make sure the block size plus 4 (ie: cheeksumSeed)
+# is not a multiple of 64 - otherwise the cached checksums
+# will not be the same for protocol versions <= 26 and > 26.
+#
+sub blockSize
+{
+ my($class, $fileSize, $defaultBlkSize) = @_;
+
+ my $blkSize = int($fileSize / 10000);
+ $blkSize = $defaultBlkSize if ( $blkSize < $defaultBlkSize );
+ $blkSize = 16384 if ( $blkSize > 16384 );
+ $blkSize += 4 if ( (($blkSize + 4) % 64) == 0 );
+ return $blkSize;
+}
+
+#
+# Compute and add rsync block and file digests to the given file.
+#
+sub digestAdd
+{
+ my($class, $file, $blockSize, $checksumSeed) = @_;
+ if ( $blockSize == 0 ) {
+ print("bogus digestAdd($file, $blockSize, $checksumSeed)\n");
+ $blockSize = 2048;
+ }
+ my $nBlks = int(65536 * 16 / $blockSize) + 1;
+ my($data, $blockDigest, $fileDigest);
+
+ return if ( !$RsyncLibOK );
+
+ my $digest = File::RsyncP::Digest->new;
+ $digest->add(pack("V", $checksumSeed)) if ( $checksumSeed );
+
+ return -1 if ( !defined(my $fh = BackupPC::FileZIO->open($file, 0, 1)) );
+ while ( 1 ) {
+ $fh->read(\$data, $nBlks * $blockSize);
+ last if ( $data eq "" );
+ $blockDigest .= $digest->blockDigest($data, $blockSize, 16,
+ $checksumSeed);
+ $digest->add($data);
+ }
+ $fileDigest = $digest->digest2;
+ my $eofPosn = tell($fh->{fh});
+ $fh->close;
+ my $rsyncData = $blockDigest . $fileDigest;
+ my $metaData = pack("VVVV", $blockSize,
+ $checksumSeed,
+ length($blockDigest) / 20,
+ 0x5fe3c289, # magic number
+ );
+ my $data2 = chr(0xb3) . $rsyncData . $metaData;
+# printf("appending %d+%d bytes to %s at offset %d\n",
+# length($rsyncData),
+# length($metaData),
+# $file,
+# $eofPosn);
+ open(my $fh2, "+<", $file) || return -2;
+ binmode($fh2);
+ return -3 if ( sysread($fh2, $data, 1) != 1 );
+ if ( $data ne chr(0x78) && $data ne chr(0xd6) ) {
+ printf("Unexpected first char 0x%x\n", ord($data));
+ return -4;
+ }
+ return -5 if ( sysseek($fh2, $eofPosn, 0) != $eofPosn );
+ return -6 if ( syswrite($fh2, $data2) != length($data2) );
+ return -7 if ( !defined(sysseek($fh2, 0, 0)) );
+ return -8 if ( syswrite($fh2, chr(0xd6)) != 1 );
+ close($fh2);
+}
+
+#
+# Return rsync checksums for the given file. We read the cached checksums
+# if they exist and the block size and checksum seed match. Otherwise
+# we compute the checksums from the file contents.
+#
+sub digestStart
+{
+ my($class, $fileName, $fileSize, $blockSize, $defBlkSize,
+ $checksumSeed, $needMD4, $compress, $doCache) = @_;
+
+ return -1 if ( !$RsyncLibOK );
+
+ my $data;
+
+ my $fio = bless {
+ name => $fileName,
+ needMD4 => $needMD4,
+ digest => File::RsyncP::Digest->new,
+ }, $class;
+
+ if ( $fileSize > 0 && $compress ) {
+ open(my $fh, "<", $fileName) || return -2;
+ binmode($fh);
+ return -3 if ( read($fh, $data, 1) != 1 );
+ if ( $data eq chr(0x78) && $doCache && $checksumSeed == 32761 ) {
+ #
+ # 32761 is the magic number that rsync uses for checksumSeed
+ # with the --fixed-csum option.
+ #
+ # We now add the cached checksum data to the file. There
+ # is a possible race condition here since two BackupPC_dump
+ # processes might call this function at the same time
+ # on the same file. But this should be ok since both
+ # processes will write the same data, and the order
+ # in which they write it doesn't matter.
+ #
+ close($fh);
+ $fio->digestAdd($fileName,
+ $blockSize || $fio->blockSize($fileSize, $defBlkSize),
+ $checksumSeed);
+ #
+ # now re-open the file and re-read the first byte
+ #
+ open($fh, "<", $fileName) || return -2;
+ binmode($fh);
+ return -3 if ( read($fh, $data, 1) != 1 );
+ }
+ if ( $data eq chr(0xd6) ) {
+ #
+ # Looks like this file has cached checksums
+ # Read the last 48 bytes: that's 2 file MD4s (32 bytes)
+ # plus 4 words of meta data
+ #
+ return -4 if ( !defined(seek($fh, -48, 2)) );
+ return -5 if ( read($fh, $data, 48) != 48 );
+ ($fio->{md4DigestOld},
+ $fio->{md4Digest},
+ $fio->{blockSize},
+ $fio->{checksumSeed},
+ $fio->{nBlocks},
+ $fio->{magic}) = unpack("a16 a16 V V V V", $data);
+ if ( $fio->{magic} == 0x5fe3c289
+ && $fio->{checksumSeed} == $checksumSeed
+ && ($blockSize == 0 || $fio->{blockSize} == $blockSize) ) {
+ $fio->{fh} = $fh;
+ $fio->{cached} = 1;
+ } else {
+ close($fh);
+ }
+ #
+ # position the file at the start of the rsync block checksums
+ # (4 (adler) + 16 (md4) bytes each)
+ #
+ return -6 if ( !defined(seek($fh, -$fio->{nBlocks}*20 - 48, 2)) );
+ }
+ }
+ if ( !$fio->{cached} ) {
+ #
+ # This file doesn't have cached checksums, or the checksumSeed
+ # or blocksize doesn't match. Open the file and prepare to
+ # compute the checksums.
+ #
+ $blockSize = BackupPC::RsyncDigest->blockSize($fileSize, $defBlkSize)
+ if ( $blockSize == 0 );
+ $fio->{checksumSeed} = $checksumSeed;
+ $fio->{blockSize} = $blockSize;
+ $fio->{fh} = BackupPC::FileZIO->open($fileName, 0, $compress);
+ return -7 if ( !defined($fio->{fh}) );
+ if ( $needMD4) {
+ $fio->{csumDigest} = File::RsyncP::Digest->new;
+ $fio->{csumDigest}->add(pack("V", $fio->{checksumSeed}));
+ }
+ }
+ return (undef, $fio, $fio->{blockSize});
+}
+
+sub digestGet
+{
+ my($fio, $num, $csumLen) = @_;
+ my($fileData);
+ my $blockSize = $fio->{blockSize};
+
+ if ( $fio->{cached} ) {
+ my $thisNum = $num;
+ $thisNum = $fio->{nBlocks} if ( $thisNum > $fio->{nBlocks} );
+ read($fio->{fh}, $fileData, 20 * $thisNum);
+ $fio->{nBlocks} -= $thisNum;
+ if ( $thisNum < $num ) {
+ #
+ # unexpected shortfall of data; pad with zero digest
+ #
+ $fileData .= pack("c", 0) x (20 * ($num - $thisNum));
+ }
+ return $fio->{digest}->blockDigestExtract($fileData, $csumLen);
+ } else {
+ if ( $fio->{fh}->read(\$fileData, $blockSize * $num) <= 0 ) {
+ #
+ # unexpected shortfall of data; pad with zeros
+ #
+ $fileData = pack("c", 0) x ($blockSize * $num);
+ }
+ $fio->{csumDigest}->add($fileData) if ( $fio->{needMD4} );
+ return $fio->{digest}->blockDigest($fileData, $blockSize,
+ $csumLen, $fio->{checksumSeed});
+ }
+}
+
+sub digestEnd
+{
+ my($fio) = @_;
+ my($fileData);
+
+ if ( $fio->{cached} ) {
+ close($fio->{fh});
+ return $fio->{md4DigestOld} if ( $fio->{needMD4} );
+ } else {
+ #
+ # make sure we read the entire file for the file MD4 digest
+ #
+ if ( $fio->{needMD4} ) {
+ my $fileData;
+ while ( $fio->{fh}->read(\$fileData, 65536) > 0 ) {
+ $fio->{csumDigest}->add($fileData);
+ }
+ }
+ $fio->{fh}->close();
+ return $fio->{csumDigest}->digest if ( $fio->{needMD4} );
+ }
+}
+
+1;
#
#========================================================================
#
-# Version 2.1.0_CVS, released 3 Jul 2003.
+# Version 2.1.0_CVS, released 8 Feb 2004.
#
# See http://backuppc.sourceforge.net.
#
$dir =~ s{/+$}{};
return if ( $m->{num} == $backupNum
&& $m->{share} eq $share
+ && defined($m->{dir})
&& $m->{dir} eq $dir );
- if ( $m->{num} != $backupNum ) {
- for ( $i = 0 ; $i < @{$m->{backups}} ; $i++ ) {
- last if ( $m->{backups}[$i]{num} == $backupNum );
- }
- if ( $i >= @{$m->{backups}} ) {
- $m->{idx} = -1;
- return;
- }
- $m->{num} = $backupNum;
- $m->{idx} = $i;
- }
+ $m->backupNumCache($backupNum) if ( $m->{num} != $backupNum );
+ return if ( $m->{idx} < 0 );
+
$m->{files} = {};
$level = $m->{backups}[$m->{idx}]{level} + 1;
#print STDERR "Returning:\n", Dumper($m->{files});
}
+#
+# Return list of shares for this backup
+#
+sub shareList
+{
+ my($m, $backupNum) = @_;
+ my @shareList;
+
+ $m->backupNumCache($backupNum) if ( $m->{num} != $backupNum );
+ return if ( $m->{idx} < 0 );
+
+ my $mangle = $m->{backups}[$m->{idx}]{mangle};
+ my $path = "$m->{topDir}/pc/$m->{host}/$backupNum/";
+ return if ( !opendir(DIR, $path) );
+ my @dir = readdir(DIR);
+ closedir(DIR);
+ foreach my $file ( @dir ) {
+ $file = $1 if ( $file =~ /(.*)/ );
+ next if ( $file eq "attrib" && $mangle
+ || $file eq "."
+ || $file eq ".." );
+ my $fileUM = $file;
+ $fileUM = $m->{bpc}->fileNameUnmangle($fileUM) if ( $mangle );
+ push(@shareList, $fileUM);
+ }
+ $m->{dir} = undef;
+ return @shareList;
+}
+
+sub backupNumCache
+{
+ my($m, $backupNum) = @_;
+
+ if ( $m->{num} != $backupNum ) {
+ my $i;
+ for ( $i = 0 ; $i < @{$m->{backups}} ; $i++ ) {
+ last if ( $m->{backups}[$i]{num} == $backupNum );
+ }
+ if ( $i >= @{$m->{backups}} ) {
+ $m->{idx} = -1;
+ return;
+ }
+ $m->{num} = $backupNum;
+ $m->{idx} = $i;
+ }
+}
+
#
# Return the attributes of a specific file
#
{
my($m, $backupNum, $share, $path) = @_;
+ #print(STDERR "fileAttrib($backupNum, $share, $path)\n");
if ( $path =~ s{(.*)/+(.+)}{$1} ) {
my $file = $2;
$m->dirCache($backupNum, $share, $path);
} else {
#print STDERR "Got empty $path\n";
$m->dirCache($backupNum, "", "");
- my %attr = %{$m->{files}{$share}};
- $attr{relPath} = "/";
- return \%attr;
+ my $attr = $m->{files}{$share};
+ return if ( !defined($attr) );
+ $attr->{relPath} = "/";
+ return $attr;
}
}
{
my($m, $backupNum, $share, $path, $depth, $callback, @callbackArgs) = @_;
+ #print(STDERR "find: got $backupNum, $share, $path\n");
#
# First call the callback on the given $path
#
#
#========================================================================
#
-# Version 2.1.0_CVS, released 3 Jul 2003.
+# Version 2.1.0_CVS, released 8 Feb 2004.
#
# See http://backuppc.sourceforge.net.
#
$t->{xferOK} = 1;
@HostList = $t->{HostList};
@BackupList = $t->{BackupList};
- my $i=0;
- my $tarCreatePath = $conf->{InstallDir} . "/bin/BackupPC_tarCreate";
+ my $i = 0;
+ my $tarCreatePath = "$conf->{InstallDir}/bin/BackupPC_tarCreate";
while (${@HostList[0]}[$i]) {
- #
- # Merge variables into @archiveClientCmd
- #
- my $cmdargs = {
- archiveloc => $t->{archiveloc},
- parfile => $t->{parfile},
- compression => $t->{compression},
- compext => $t->{compext},
- splitsize => $t->{splitsize},
- host => ${@HostList[0]}[$i],
- backupnumber => ${@BackupList[0]}[$i],
- Installdir => $conf->{InstallDir},
- tarCreatePath => $tarCreatePath,
- splitpath => $conf->{SplitPath},
- parpath => $conf->{ParPath},
- };
-
- $archiveClientCmd2 = $bpc->cmdVarSubstitute($archiveClientCmd, $cmdargs);
- $t->{XferLOG}->write(\"Executing: @$archiveClientCmd2\n");
-
- $bpc->cmdSystemOrEval($archiveClientCmd2,
+ #
+ # Merge variables into @archiveClientCmd
+ #
+ my $errStr;
+ my $cmdargs = {
+ archiveloc => $t->{archiveloc},
+ parfile => $t->{parfile},
+ compression => $t->{compression},
+ compext => $t->{compext},
+ splitsize => $t->{splitsize},
+ host => ${@HostList[0]}[$i],
+ backupnumber => ${@BackupList[0]}[$i],
+ Installdir => $conf->{InstallDir},
+ tarCreatePath => $tarCreatePath,
+ splitpath => $conf->{SplitPath},
+ parpath => $conf->{ParPath},
+ };
+
+ $archiveClientCmd2 = $bpc->cmdVarSubstitute($archiveClientCmd,
+ $cmdargs);
+ $t->{XferLOG}->write(\"Executing: @$archiveClientCmd2\n");
+
+ $bpc->cmdSystemOrEval($archiveClientCmd2,
sub {
+ $errStr = $_[0];
$t->{XferLOG}->write(\$_[0]);
});
-
- $i++;
+ if ( $? ) {
+ ($t->{_errStr} = $errStr) =~ s/[\n\r]+//;
+ return;
+ }
+ $i++;
}
$t->{XferLOG}->write(\"Completed Archive\n");
return "Completed Archive";
#
#========================================================================
#
-# Version 2.1.0_CVS, released 3 Jul 2003.
+# Version 2.1.0_CVS, released 8 Feb 2004.
#
# See http://backuppc.sourceforge.net.
#
$argList = ['--server', '--sender', @$rsyncArgs,
'.', $t->{shareNameSlash}];
$fioArgs = {
- client => $t->{client},
- share => $t->{shareName},
- viewNum => $t->{lastFullBkupNum},
+ client => $t->{client},
+ share => $t->{shareName},
+ viewNum => $t->{lastFullBkupNum},
+ partialNum => $t->{partialNum},
};
}
#
#========================================================================
#
-# Version 2.1.0_CVS, released 3 Jul 2003.
+# Version 2.1.0_CVS, released 8 Feb 2004.
#
# See http://backuppc.sourceforge.net.
#
use File::Path;
use BackupPC::Attrib qw(:all);
use BackupPC::View;
-use BackupPC::PoolWrite;
+use BackupPC::RsyncDigest;
use BackupPC::PoolWrite;
use Data::Dumper;
$fio->{backups});
$fio->{full} = $fio->{xfer}{type} eq "full" ? 1 : 0;
$fio->{newFilesFH} = $fio->{xfer}{newFilesFH};
+ $fio->{partialNum} = undef if ( !$fio->{full} );
return $fio;
}
#
sub csumStart
{
- my($fio, $f, $needMD4) = @_;
+ my($fio, $f, $needMD4, $defBlkSize) = @_;
my $attr = $fio->attribGet($f);
$fio->{file} = $f;
- $fio->csumEnd if ( defined($fio->{fh}) );
- return if ( $attr->{type} != BPC_FTYPE_FILE );
- if ( !defined($fio->{fh} = BackupPC::FileZIO->open($attr->{fullPath},
- 0,
- $attr->{compress})) ) {
- $fio->log("Can't open $attr->{fullPath} (name=$f->{name})");
+ $fio->csumEnd if ( defined($fio->{csum}) );
+ return -1 if ( $attr->{type} != BPC_FTYPE_FILE );
+ (my $err, $fio->{csum}, my $blkSize)
+ = BackupPC::RsyncDigest->digestStart($attr->{fullPath}, $attr->{size},
+ 0, $defBlkSize, $fio->{checksumSeed}, $needMD4,
+ $attr->{compress}, 1);
+ if ( $err ) {
+ $fio->log("Can't get rsync digests from $attr->{fullPath}"
+ . " (err=$err, name=$f->{name})");
$fio->{stats}{errorCnt}++;
return -1;
}
- if ( $needMD4) {
- $fio->{csumDigest} = File::RsyncP::Digest->new;
- $fio->{csumDigest}->add(pack("V", $fio->{checksumSeed}));
- } else {
- delete($fio->{csumDigest});
- }
+ return $blkSize;
}
sub csumGet
$num ||= 100;
$csumLen ||= 16;
-
- return if ( !defined($fio->{fh}) );
- if ( $fio->{fh}->read(\$fileData, $blockSize * $num) <= 0 ) {
- $fio->log("$fio->{file}{name}: csumGet is at EOF - zero padding");
- $fio->{stats}{errorCnt}++;
- $fileData = pack("c", 0) x ($blockSize * $num);
- }
- $fio->{csumDigest}->add($fileData) if ( defined($fio->{csumDigest}) );
- $fio->log(sprintf("%s: getting csum ($num,$csumLen,%d,0x%x)",
- $fio->{file}{name},
- length($fileData),
- $fio->{checksumSeed}))
- if ( $fio->{logLevel} >= 9 );
- return $fio->{digest}->blockDigest($fileData, $blockSize,
- $csumLen, $fio->{checksumSeed});
+ return if ( !defined($fio->{csum}) );
+ return $fio->{csum}->digestGet($num, $csumLen);
}
sub csumEnd
{
my($fio) = @_;
- return if ( !defined($fio->{fh}) );
- #
- # make sure we read the entire file for the file MD4 digest
- #
- if ( defined($fio->{csumDigest}) ) {
- my $fileData;
- while ( $fio->{fh}->read(\$fileData, 65536) > 0 ) {
- $fio->{csumDigest}->add($fileData);
- }
- }
- $fio->{fh}->close();
- delete($fio->{fh});
- return $fio->{csumDigest}->digest if ( defined($fio->{csumDigest}) );
+ return if ( !defined($fio->{csum}) );
+ return $fio->{csum}->digestEnd();
}
sub readStart
#
$fio->{viewCache}{$shareM}
= $fio->{view}->dirAttrib($fio->{viewNum}, $share, $dir);
+ #
+ # also cache partial backup attrib data too
+ #
+ if ( defined($fio->{partialNum}) ) {
+ foreach my $d ( keys(%{$fio->{partialCache}}) ) {
+ delete($fio->{partialCache}{$d}) if ( $shareM !~ m{^\Q$d/} );
+ }
+ $fio->{partialCache}{$shareM}
+ = $fio->{view}->dirAttrib($fio->{partialNum}, $share, $dir);
+ }
}
-sub attribGet
+sub attribGetWhere
{
my($fio, $f) = @_;
my($dir, $fname, $share, $shareM);
}
$fio->viewCacheDir($share, $dir);
$shareM .= "/$dir" if ( $dir ne "" );
- return $fio->{viewCache}{$shareM}{$fname};
+ if ( defined(my $attr = $fio->{viewCache}{$shareM}{$fname}) ) {
+ return ($attr, 0);
+ } elsif ( defined(my $attr = $fio->{partialCache}{$shareM}{$fname}) ) {
+ return ($attr, 1);
+ } else {
+ return;
+ }
+}
+
+sub attribGet
+{
+ my($fio, $f) = @_;
+
+ my($attr) = $fio->attribGetWhere($f);
+ return $attr;
}
sub mode2type
return if ( !defined($fio->{attrib}{$d}) );
#
# Set deleted files in the attributes. Any file in the view
- # that doesn't have attributes is deleted. All files sent by
- # rsync have attributes temporarily set so we can do deletion
- # detection. We also prune these temporary attributes.
+ # that doesn't have attributes is flagged as deleted for
+ # incremental dumps. All files sent by rsync have attributes
+ # temporarily set so we can do deletion detection. We also
+ # prune these temporary attributes.
#
if ( $d ne "" ) {
my $dir;
name => $name,
}) if ( $fio->{logLevel} >= 2 );
}
- } else {
+ } elsif ( !$fio->{full} ) {
##print("Delete file $f\n");
$fio->logFileAction("delete", {
%{$fio->{viewCache}{$d}{$f}},
}
#
-# Later we'll use this function to complete a prior unfinished dump.
-# We'll do an incremental on the part we have already, and then a
-# full or incremental against the rest.
+# If there is a partial and we are doing a full, we do an incremental
+# against the partial and a full against the rest. This subroutine
+# is how we tell File::RsyncP which files to ignore attributes on
+# (ie: against the partial dump we do consider the attributes, but
+# otherwise we ignore attributes).
#
sub ignoreAttrOnFile
{
- return undef;
+ my($fio, $f) = @_;
+
+ return if ( !defined($fio->{partialNum}) );
+ my($attr, $isPartial) = $fio->attribGetWhere($f);
+ $fio->log("$f->{name}: just checking attributes from partial")
+ if ( $isPartial && $fio->{logLevel} >= 5 );
+ return !$isPartial;
+}
+
+#
+# This is called by File::RsyncP when a file is skipped because the
+# attributes match.
+#
+sub attrSkippedFile
+{
+ my($fio, $f, $attr) = @_;
+
+ #
+ # Unless this is a partial, this is normal so ignore it.
+ #
+ return if ( !defined($fio->{partialNum}) );
+
+ $fio->log("$f->{name}: skipped in partial; adding link")
+ if ( $fio->{logLevel} >= 5 );
+ $fio->{rxLocalAttr} = $attr;
+ $fio->{rxFile} = $f;
+ $fio->{rxSize} = $attr->{size};
+ return $fio->fileDeltaRxDone();
}
#
# Need to copy the sequence of blocks that matched. If the file
# is compressed we need to make a copy of the uncompressed file,
# since the compressed file is not seekable. Future optimizations
- # would be to keep the uncompressed file in memory (eg, up to say
- # 10MB), only create an uncompressed copy if the matching
+ # could include only creating an uncompressed copy if the matching
# blocks were not monotonic, and to only do this if there are
# matching blocks (eg, maybe the entire file is new).
#
my($fio, $md4) = @_;
my $name = $1 if ( $fio->{rxFile}{name} =~ /(.*)/ );
- if ( !defined($fio->{rxDigest}) ) {
- #
- # File was exact match, but we still need to verify the
- # MD4 checksum. Therefore open and read the file.
- #
- $fio->{rxDigest} = File::RsyncP::Digest->new;
- $fio->{rxDigest}->add(pack("V", $fio->{checksumSeed}));
- my $attr = $fio->{rxLocalAttr};
- if ( defined($attr) ) {
- if ( defined(my $fh = BackupPC::FileZIO->open(
- $attr->{fullPath},
- 0,
- $attr->{compress})) ) {
- my $data;
- while ( $fh->read(\$data, 4 * 65536) > 0 ) {
- $fio->{rxDigest}->add($data);
- $fio->{rxSize} += length($data);
- }
- $fh->close;
- } else {
- $fio->log("Can't open $attr->{fullPath} for MD4 check ($name)");
- $fio->{stats}{errorCnt}++;
- }
- }
- $fio->log("$name got exact match")
- if ( $fio->{logLevel} >= 5 );
- }
close($fio->{rxInFd}) if ( defined($fio->{rxInFd}) );
unlink("$fio->{outDirSh}RStmp") if ( -f "$fio->{outDirSh}RStmp" );
- my $newDigest = $fio->{rxDigest}->digest;
- if ( $fio->{logLevel} >= 3 ) {
- my $md4Str = unpack("H*", $md4);
- my $newStr = unpack("H*", $newDigest);
- $fio->log("$name got digests $md4Str vs $newStr")
- }
- if ( $md4 ne $newDigest ) {
- $fio->log("$name: fatal error: md4 doesn't match");
- $fio->{stats}{errorCnt}++;
- if ( defined($fio->{rxOutFd}) ) {
- $fio->{rxOutFd}->close;
- unlink($fio->{rxOutFile});
+
+ #
+ # Check the final md4 digest
+ #
+ if ( defined($md4) ) {
+ my $newDigest;
+ if ( !defined($fio->{rxDigest}) ) {
+ #
+ # File was exact match, but we still need to verify the
+ # MD4 checksum. Compute the md4 digest (or fetch the
+ # cached one.)
+ #
+ if ( defined(my $attr = $fio->{rxLocalAttr}) ) {
+ #
+ # block size doesn't matter: we're only going to
+ # fetch the md4 file digest, not the block digests.
+ #
+ my($err, $csum, $blkSize)
+ = BackupPC::RsyncDigest->digestStart(
+ $attr->{fullPath}, $attr->{size},
+ 0, 2048, $fio->{checksumSeed}, 1,
+ $attr->{compress});
+ if ( $err ) {
+ $fio->log("Can't open $attr->{fullPath} for MD4"
+ . " check (err=$err, $name)");
+ $fio->{stats}{errorCnt}++;
+ } else {
+ $newDigest = $csum->digestEnd;
+ }
+ $fio->{rxSize} = $attr->{size};
+ } else {
+ #
+ # Empty file; just create an empty file digest
+ #
+ $fio->{rxDigest} = File::RsyncP::Digest->new;
+ $fio->{rxDigest}->add(pack("V", $fio->{checksumSeed}));
+ $newDigest = $fio->{rxDigest}->digest;
+ }
+ $fio->log("$name got exact match") if ( $fio->{logLevel} >= 5 );
+ } else {
+ $newDigest = $fio->{rxDigest}->digest;
+ }
+ if ( $fio->{logLevel} >= 3 ) {
+ my $md4Str = unpack("H*", $md4);
+ my $newStr = unpack("H*", $newDigest);
+ $fio->log("$name got digests $md4Str vs $newStr")
+ }
+ if ( $md4 ne $newDigest ) {
+ $fio->log("$name: fatal error: md4 doesn't match");
+ $fio->{stats}{errorCnt}++;
+ if ( defined($fio->{rxOutFd}) ) {
+ $fio->{rxOutFd}->close;
+ unlink($fio->{rxOutFile});
+ }
+ return 1;
}
- return 1;
}
+
#
# One special case is an empty file: if the file size is
# zero we need to open the output file to create it.
#
#========================================================================
#
-# Version 2.1.0_CVS, released 3 Jul 2003.
+# Version 2.1.0_CVS, released 8 Feb 2004.
#
# See http://backuppc.sourceforge.net.
#
#
# Run smbclient.
#
+ alarm(0);
$bpc->cmdExecOrEval($smbClientCmd, $args);
# should not be reached, but just in case...
$t->{_errStr} = "Can't exec $conf->{SmbClientPath}";
while ( $t->{smbOut} =~ /(.*?)[\n\r]+(.*)/s ) {
$_ = $1;
$t->{smbOut} = $2;
+ #
+ # ignore the log file time stamps from smbclient introduced
+ # in version 3.0.0 - don't even write them to the log file.
+ #
+ next if ( m{^\[\d+/\d+/\d+ +\d+:\d+:\d+.*\] +(client/cli|lib/util_unistr).*\(\d+\)} );
$t->{XferLOG}->write(\"$_\n");
#
# refresh our inactivity alarm
# This section is highly dependent on the version of smbclient.
# If you upgrade Samba, make sure that these regexp are still valid.
#
- if ( /^\s*(-?\d+) \(\s*\d+\.\d kb\/s\) (.*)$/ ) {
+ if ( /^\s*(-?\d+) \(\s*\d+[.,]\d kb\/s\) (.*)$/ ) {
my $sambaFileSize = $1;
my $pcFileName = $2;
(my $fileName = $pcFileName) =~ s/\\/\//g;
} elsif ( /restore tar file (.*) of size (\d+) bytes/ ) {
$t->{byteCnt} += $2;
$t->{fileCnt}++;
- } elsif ( /tar: dumped \d+ files/ ) {
+ } elsif ( /^\s*tar: dumped \d+ files/ ) {
$t->{xferOK} = 1;
- } elsif ( /^tar: restored \d+ files/ ) {
+ } elsif ( /^\s*tar: restored \d+ files/ ) {
$t->{xferOK} = 1;
- } elsif ( /^read_socket_with_timeout: timeout read. /i ) {
+ } elsif ( /^\s*read_socket_with_timeout: timeout read. /i ) {
$t->{hostAbort} = 1;
} elsif ( /^code 0 listing /
- || /^code 0 opening /
- || /^abandoning restore/i
- || /^Error: Looping in FIND_NEXT/i
- || /^SUCCESS - 0/i
- || /^Call timed out: server did not respond/i
- || /^tree connect failed: ERRDOS - ERRnoaccess \(Access denied\.\)/
- || /^tree connect failed: NT_STATUS_BAD_NETWORK_NAME/
+ || /^\s*code 0 opening /
+ || /^\s*abandoning restore/i
+ || /^\s*Error: Looping in FIND_NEXT/i
+ || /^\s*SUCCESS - 0/i
+ || /^\s*Call timed out: server did not respond/i
+ || /^\s*tree connect failed: ERRDOS - ERRnoaccess \(Access denied\.\)/
+ || /^\s*tree connect failed: NT_STATUS_BAD_NETWORK_NAME/
) {
if ( $t->{hostError} eq "" ) {
$t->{XferLOG}->write(\"This backup will fail because: $_\n");
$t->{hostError} = $_;
}
- } elsif ( /^NT_STATUS_ACCESS_DENIED listing (.*)/
- || /^ERRDOS - ERRnoaccess \(Access denied\.\) listing (.*)/ ) {
+ } elsif ( /^\s*NT_STATUS_ACCESS_DENIED listing (.*)/
+ || /^\s*ERRDOS - ERRnoaccess \(Access denied\.\) listing (.*)/ ) {
my $badDir = $1;
$badDir =~ s{\\}{/}g;
$badDir =~ s{/+}{/}g;
$t->{hostError} ||= $_;
}
} elsif ( /smb: \\>/
- || /^added interface/i
- || /^tarmode is now/i
- || /^Total bytes written/i
- || /^Domain=/i
+ || /^\s*added interface/i
+ || /^\s*tarmode is now/i
+ || /^\s*Total bytes written/i
+ || /^\s*Domain=/i
|| /^\([\d\.]* kb\/s\) \(average [\d\.]* kb\/s\)$/i
- || /^Getting files newer than/i
- || /^\s+directory \\/i
- || /^Output is \/dev\/null/i
- || /^Timezone is/i ) {
+ || /^\s*Getting files newer than/i
+ || /^\s*directory \\/i
+ || /^\s*restore directory \\/i
+ || /^\s*Output is \/dev\/null/i
+ || /^\s*Timezone is/i
+ || /^\s*creating lame (up|low)case table/i
+ ) {
# ignore these messages
} else {
$t->{xferErrCnt}++;
#
#========================================================================
#
-# Version 2.1.0_CVS, released 3 Jul 2003.
+# Version 2.1.0_CVS, released 8 Feb 2004.
#
# See http://backuppc.sourceforge.net.
#
#
# Run the tar command
#
+ alarm(0);
$bpc->cmdExecOrEval($tarClientCmd, $args);
# should not be reached, but just in case...
$t->{_errStr} = "Can't exec @$tarClientCmd";
#
#========================================================================
#
-# Version 2.1.0_CVS, released 3 Jul 2003.
+# Version 2.1.0_CVS, released 8 Feb 2004.
#
# See http://backuppc.sourceforge.net.
#
umask(0022);
my $Version = "2.1.0_CVS";
-my $ReleaseDate = "3 Jul 2003";
+my $ReleaseDate = "8 Feb 2004";
my $DistDir = "dist/BackupPC-$Version";
my @PerlSrc = qw(
bin/BackupPC
bin/BackupPC_archive
- bin/BackupPC_archivecd
- bin/BackupPC_archivetape
+ bin/BackupPC_archiveHost
bin/BackupPC_dump
bin/BackupPC_link
bin/BackupPC_nightly
print OUT "$1'__INSTALLDIR__',\n";
} elsif ( $file =~ /Lib.pm/ && /(.*LibDir *=> .*)'.*',/ ) {
print OUT "$1'__INSTALLDIR__',\n";
+ } elsif ( $file =~ /BackupPC_Admin/ && /(my *\$installDir *= *)'.*'/ ) {
+ print OUT "$1'__INSTALLDIR__/lib';\n";
} else {
print OUT;
}