--- /dev/null
+#========================================================================
+#
+# CVS_README - CVS README file for BackupPC.
+#
+# DESCRIPTION
+# Instructions for using CVS
+#
+# AUTHOR
+# Craig Barratt <cbarratt@users.sourceforge.net>
+#
+#========================================================================
+#
+# See http://backuppc.sourceforge.net.
+#
+#========================================================================
+
+Fetching CVS:
+------------
+
+* To fetch the current CVS code run this commands:
+
+ mkdir somewhere/BackupPC
+ cd somewhere/BackupPC
+ cvs -z3 -d:pserver:anonymous@cvs.backuppc.sourceforge.net:/cvsroot/backuppc co BackupPC
+
+* To fetch the CVS code tagged at a particular release (eg: v1.5.0):
+
+ cvs -z3 -d:pserver:anonymous@cvs.backuppc.sourceforge.net:/cvsroot/backuppc co -r v1_5_0 BackupPC
+
+Building an installable release from the source:
+-----------------------------------------------
+
+* Edit makeDist and set the version number and release date
+
+* Update makeDist and configure.pl if you add any new files to the release.
+
+* Run makeDist. makeDist merges the version number, release date and turns
+ all the library paths etc back into the symbolic form (eg: __INSTALLDIR__)
+ so that configure.pl will do the right thing.
+
+* You should now have a sub-directory dist/BackupPC-version containing
+ the release and a tar ball dist/BackupPC-version.tar.gz. The tar
+ ball can be copied, extracted and installed like any BackupPC release.
#
#========================================================================
#
-# Version 1.5.0, released 2 Aug 2002.
+# Version __VERSION__, released __RELEASEDATE__.
#
# See http://backuppc.sourceforge.net.
#
#========================================================================
+#------------------------------------------------------------------------
+# Version __VERSION__, __RELEASEDATE__
+#------------------------------------------------------------------------
+
+* Added internationalization (i18n) code from Xavier Nicollet.
+ Voila! BackupPC_Admin now supports English and French, and
+ adding more languages is now easy.
+
+* Added patch from Toby Johnson that allows additional users to be
+ specified in the hosts file; these users can also view/start/stop
+ and restore backups for that host. Also added a new config
+ setting $Conf{CgiNavBarAdminAllHosts} that allows all hosts to
+ be listed in the left nav bar for admins.
+
+* Added "PerlTaintCheck On" to the mod_perl section in the docs,
+ suggested by Tim Demarest.
+
#------------------------------------------------------------------------
# Version 1.5.0, 2 Aug 2002
#------------------------------------------------------------------------
-#!/bin/perl -T
+#!/usr/bin/perl -T
#============================================================= -*-perl-*-w
#
# BackupPC_Admin: Apache/CGI interface for BackupPC.
#
#========================================================================
#
-# Version 1.5.0, released 2 Aug 2002.
+# Version 1.5.0beta0, released 30 Jun 2002.
#
# See http://backuppc.sourceforge.net.
#
use strict;
use CGI;
-use lib "__INSTALLDIR__/lib";
+use lib "/usr/local/BackupPC/lib";
use BackupPC::Lib;
use BackupPC::FileZIO;
use BackupPC::Attrib qw(:all);
use vars qw($Hosts $HostsMTime $ConfigMTime $PrivAdmin);
use vars qw(%UserEmailInfo $UserEmailInfoMTime %RestoreReq);
+use vars qw ($Lang);
+
$Cgi = new CGI;
%In = $Cgi->Vars;
$User = $ENV{REMOTE_USER};
if ( !defined($bpc) ) {
- ErrorExit("BackupPC::Lib->new failed: check apache error_log\n")
- if ( !($bpc = BackupPC::Lib->new) );
+ ErrorExit($Lang->{BackupPC__Lib__new_failed__check_apache_error_log})
+ if ( !($bpc = BackupPC::Lib->new) );
$TopDir = $bpc->TopDir();
$BinDir = $bpc->BinDir();
%Conf = $bpc->Conf();
+ $Lang = $bpc->Lang();
$ConfigMTime = $bpc->ConfigMTime();
} elsif ( $bpc->ConfigMTime() != $ConfigMTime ) {
$bpc->ConfigRead();
%Conf = $bpc->Conf();
$ConfigMTime = $bpc->ConfigMTime();
+ $Lang = $bpc->Lang();
}
#
#
if ( $Conf{BackupPCUserVerify}
&& $> != (my $uid = (getpwnam($Conf{BackupPCUser}))[2]) ) {
- ErrorExit("Wrong user: my userid is $>, instead of $uid"
- . " ($Conf{BackupPCUser})\n");
+ ErrorExit(eval("qq{$Lang->{Wrong_user__my_userid_is___}}"));
}
if ( !defined($Hosts) || $bpc->HostsMTime() != $HostsMTime ) {
$HostsMTime = $bpc->HostsMTime();
$Hosts = $bpc->HostInfoRead();
+
+ # turn operators list into a hash for quick lookups
+ foreach my $host (keys %$Hosts) {
+ $Hosts->{$host}{moreUsers} =
+ {map {$_, 1} split(",", $Hosts->{$host}{moreUsers}) }
+ }
}
my %ActionDispatch = (
- "summary" => \&Action_Summary,
- "Start Incr Backup" => \&Action_StartStopBackup,
- "Start Full Backup" => \&Action_StartStopBackup,
- "Stop/Dequeue Backup" => \&Action_StartStopBackup,
- "queue" => \&Action_Queue,
- "view" => \&Action_View,
- "LOGlist" => \&Action_LOGlist,
- "emailSummary" => \&Action_EmailSummary,
- "browse" => \&Action_Browse,
- "Restore" => \&Action_Restore,
- "RestoreFile" => \&Action_RestoreFile,
- "hostInfo" => \&Action_HostInfo,
- "generalInfo" => \&Action_GeneralInfo,
- "restoreInfo" => \&Action_RestoreInfo,
+ "summary" => \&Action_Summary,
+ $Lang->{Start_Incr_Backup} => \&Action_StartStopBackup,
+ $Lang->{Start_Full_Backup} => \&Action_StartStopBackup,
+ $Lang->{Stop_Dequeue_Backup} => \&Action_StartStopBackup,
+ "queue" => \&Action_Queue,
+ "view" => \&Action_View,
+ "LOGlist" => \&Action_LOGlist,
+ "emailSummary" => \&Action_EmailSummary,
+ "browse" => \&Action_Browse,
+ $Lang->{Restore} => \&Action_Restore,
+ "RestoreFile" => \&Action_RestoreFile,
+ $Lang->{hostInfo} => \&Action_HostInfo,
+ "generalInfo" => \&Action_GeneralInfo,
+ "restoreInfo" => \&Action_RestoreInfo,
);
#
# Set default actions, then call sub handler
#
-$In{action} ||= "hostInfo" if ( defined($In{host}) );
+$In{action} ||= $Lang->{hostInfo} if ( defined($In{host}) );
$In{action} = "generalInfo" if ( !defined($ActionDispatch{$In{action}}) );
$ActionDispatch{$In{action}}();
exit(0);
my $Privileged = CheckPermission();
if ( !$Privileged ) {
- ErrorExit("Only privileged users can view PC summaries." );
+ ErrorExit($Lang->{Only_privileged_users_can_view_PC_summaries} );
}
foreach my $host ( sort(keys(%Status)) ) {
my($fullDur, $incrCnt, $incrAge, $fullSize, $fullRate);
$fullTot += $fullCnt;
$incrTot += $incrCnt;
$fullSize = sprintf("%.2f", $fullSize / 1000);
+ if (! $incrAge) { $incrAge = " "; }
$str = <<EOF;
<tr><td> ${HostLink($host)} </td>
<td align="center"> ${UserLink($Hosts->{$host}{user})} </td>
$incrSizeTot = sprintf("%.2f", $incrSizeTot / 1000);
my $now = timeStamp2(time);
- Header("BackupPC: Server Summary");
+ Header($Lang->{BackupPC__Server_Summary});
+ print eval ("qq{$Lang->{BackupPC_Summary}}");
- print <<EOF;
-
-${h1("BackupPC Summary")}
-<p>
-This status was generated at $now.
-<p>
-
-${h2("Hosts with good Backups")}
-<p>
-There are $hostCntGood hosts that have been backed up, for a total of:
-<ul>
-<li> $fullTot full backups of total size ${fullSizeTot}GB
- (prior to pooling and compression),
-<li> $incrTot incr backups of total size ${incrSizeTot}GB
- (prior to pooling and compression).
-</ul>
-<table border>
-<tr><td> Host </td>
- <td align="center"> User </td>
- <td align="center"> #Full </td>
- <td align="center"> Full Age/days </td>
- <td align="center"> Full Size/GB </td>
- <td align="center"> Speed MB/sec </td>
- <td align="center"> #Incr </td>
- <td align="center"> Incr Age/days </td>
- <td align="center"> State </td>
- <td align="center"> Last attempt </td></tr>
-$strGood
-</table>
-<p>
-
-${h2("Hosts with no Backups")}
-<p>
-There are $hostCntNone hosts with no backups.
-<p>
-<table border>
-<tr><td> Host </td>
- <td align="center"> User </td>
- <td align="center"> #Full </td>
- <td align="center"> Full Age/days </td>
- <td align="center"> Full Size/GB </td>
- <td align="center"> Speed MB/sec </td>
- <td align="center"> #Incr </td>
- <td align="center"> Incr Age/days </td>
- <td align="center"> Current State </td>
- <td align="center"> Last backup attempt </td></tr>
-$strNone
-</table>
-EOF
Trailer();
}
sub Action_StartStopBackup
{
my($str, $reply);
- my $start = 1 if ( $In{action} eq "Start Incr Backup"
- || $In{action} eq "Start Full Backup" );
- my $doFull = $In{action} eq "Start Full Backup" ? 1 : 0;
+
+ my $start = 1 if ( $In{action} eq $Lang->{Start_Incr_Backup}
+ || $In{action} eq $Lang->{Start_Full_Backup} );
+ my $doFull = $In{action} eq $Lang->{Start_Full_Backup} ? 1 : 0;
my $type = $doFull ? "full" : "incremental";
my $host = $In{host};
my $Privileged = CheckPermission($host);
if ( !$Privileged ) {
- ErrorExit("Only privileged users can stop or start backups on"
- . " ${EscapeHTML($host)}.");
+ ErrorExit(eval("qq{$Lang->{Only_privileged_users_can_stop_or_start_backups}}"));
}
ServerConnect();
if ( $In{doit} ) {
if ( $start ) {
if ( $Hosts->{$host}{dhcp} ) {
- $reply = $bpc->ServerMesg("backup $In{hostIP} $host"
- . " $User $doFull");
- $str = "Backup requested on DHCP $host ($In{hostIP}) by"
- . " $User from $ENV{REMOTE_ADDR}";
+ $reply = $bpc->ServerMesg(eval("qq{$Lang->{backup__In_hostIP___host}}"));
+ $str = eval("qq{$Lang->{Backup_requested_on_DHCP__host}}");
} else {
- $reply = $bpc->ServerMesg("backup $host $host $User $doFull");
- $str = "Backup requested on $host by $User";
+ $reply = $bpc->ServerMesg(eval("qq{$Lang->{backup__host__host__User__doFull}}"));
+ $str = eval("qq{$Lang->{Backup_requested_on__host_by__User}}");
}
} else {
- $reply = $bpc->ServerMesg("stop $host $User $In{backoff}");
- $str = "Backup stopped/dequeued on $host by $User";
+ $reply = $bpc->ServerMesg(eval("qq{$Lang->{stop__host__User__In_backoff}}"));
+ $str = eval("qq{$Lang->{Backup_stopped_dequeued_on__host_by__User}}");
}
- Header("BackupPC: Backup Requested on $host");
- print <<EOF;
-${h1($str)}
-<p>
-Reply from server was: $reply
-<p>
-Go back to <a href="$MyURL?host=$host">$host home page</a>.
-EOF
+
+ Header(eval ("qq{$Lang->{BackupPC__Backup_Requested_on__host}}") );
+ print (eval ("qq{$Lang->{REPLY_FROM_SERVER}}"));
+
Trailer();
} else {
if ( $start ) {
my $ipAddr = ConfirmIPAddress($host);
- Header("BackupPC: Start Backup Confirm on $host");
- print <<EOF;
-${h1("Are you sure?")}
-<p>
-You are about to start a $type backup on $host.
-
-<form action="$MyURL" method="get">
-<input type="hidden" name="host" value="$host">
-<input type="hidden" name="hostIP" value="$ipAddr">
-<input type="hidden" name="doit" value="1">
-Do you really want to do this?
-<input type="submit" value="$In{action}" name="action">
-<input type="submit" value="No" name="">
-</form>
-EOF
+ Header($Lang->{BackupPC__Start_Backup_Confirm_on__host});
+ print (eval ("qq{$Lang->{Are_you_sure_start}}"));
} else {
my $backoff = "";
GetStatusInfo("host($host)");
$backoff = sprintf("%.1f",
($StatusHost{backoffTime} - time) / 3600);
}
- Header("BackupPC: Stop Backup Confirm on $host");
- print <<EOF;
-${h1("Are you sure?")}
-<p>
-You are about to stop/dequeue backups on $host;
-
-<form action="$MyURL" method="get">
-<input type="hidden" name="host" value="$host">
-<input type="hidden" name="doit" value="1">
-Also, please don't start another backup for
-<input type="text" name="backoff" size="10" value="$backoff"> hours.
-<p>
-Do you really want to do this?
-<input type="submit" value="$In{action}" name="action">
-<input type="submit" value="No" name="">
-</form>
-EOF
+ Header($Lang->{BackupPC__Stop_Backup_Confirm_on__host});
+ print (eval ("qq{$Lang->{Are_you_sure_stop}}"));
}
Trailer();
}
my $Privileged = CheckPermission();
if ( !$Privileged ) {
- ErrorExit("Only privileged users can view queues." );
+ ErrorExit($Lang->{Only_privileged_users_can_view_queues_});
}
while ( @BgQueue ) {
<td> $cmd </td></tr>
EOF
}
- Header("BackupPC: Queue Summary");
- print <<EOF;
-${h1("Backup Queue Summary")}
-<p>
-${h2("User Queue Summary")}
-<p>
-The following user requests are currently queued:
-<table border>
-<tr><td> Host </td>
- <td> Req Time </td>
- <td> User </td></tr>
-$strUser
-</table>
-<p>
-
-${h2("Background Queue Summary")}
-<p>
-The following background requests are currently queued:
-<table border>
-<tr><td> Host </td>
- <td> Req Time </td>
- <td> User </td></tr>
-$strBg
-</table>
-<p>
-
-${h2("Command Queue Summary")}
-<p>
-The following command requests are currently queued:
-<table border>
-<tr><td> Host </td>
- <td> Req Time </td>
- <td> User </td>
- <td> Command </td></tr>
-$strCmd
-</table>
-EOF
+ Header($Lang->{BackupPC__Queue_Summary});
+
+ print ( eval ( "qq{$Lang->{Backup_Queue_Summary}}") );
+
Trailer();
}
my($file, $comment);
my $ext = $num ne "" ? ".$num" : "";
- ErrorExit("Invalid number $num") if ( $num ne "" && $num !~ /^\d+$/ );
+ ErrorExit(eval("qq{$Lang->{Invalid_number__num}}")) if ( $num ne "" && $num !~ /^\d+$/ );
if ( $type eq "XferLOG" ) {
$file = "$TopDir/pc/$host/SmbLOG$ext";
$file = "$TopDir/pc/$host/XferLOG$ext" if ( !-f $file && !-f "$file.z");
} elsif ( $type eq "docs" ) {
$file = "$BinDir/../doc/BackupPC.html";
if ( open(LOG, $file) ) {
- Header("BackupPC: Documentation");
+ Header($Lang->{BackupPC__Documentation});
print while ( <LOG> );
close(LOG);
Trailer();
} else {
- ErrorExit("Unable to open $file: configuration problem?");
+ ErrorExit(eval("qq{$Lang->{Unable_to_open__file__configuration_problem}}"));
}
return;
} elsif ( $type eq "config" ) {
$linkHosts = 1;
}
if ( !$Privileged ) {
- ErrorExit("Only privileged users can view log or config files." );
+ ErrorExit($Lang->{Only_privileged_users_can_view_log_or_config_files});
}
if ( !-f $file && -f "$file.z" ) {
$file .= ".z";
$compress = 1;
}
- Header("BackupPC: Log File $file");
- print <<EOF;
-${h1("Log File $file $comment")}
-<p>
-EOF
+ Header(eval("qq{$Lang->{Backup_PC__Log_File__file}}") );
+ print( eval ("qq{$Lang->{Log_File__file__comment}}"));
if ( defined($fh = BackupPC::FileZIO->open($file, 0, $compress)) ) {
my $mtimeStr = $bpc->timeStamp((stat($file))[9], 1);
- print <<EOF;
-Contents of log file <tt>$file</tt>, modified $mtimeStr $comment
-EOF
+
+ print ( eval ("qq{$Lang->{Contents_of_log_file}}"));
+
print "<pre>";
if ( $type eq "XferErr" || $type eq "XferErrbad"
|| $type eq "RestoreErr" ) {
while ( 1 ) {
$_ = $fh->readLine();
if ( $_ eq "" ) {
- print("[ skipped $skipped lines ]\n") if ( $skipped );
+ print(eval ("qq{$Lang->{skipped__skipped_lines}}"));
last;
}
if ( /smb: \\>/
$skipped++;
next;
}
- print("[ skipped $skipped lines ]\n") if ( $skipped );
+ print(eval("qq{$Lang->{skipped__skipped_lines}}")) if ( $skipped );
$skipped = 0;
print ${EscapeHTML($_)};
}
}
$fh->close();
} else {
- printf("<pre>\nCan't open log file $file\n");
+ printf( eval("qq{$Lang->{_pre___Can_t_open_log_file__file}}"));
}
print <<EOF;
</pre>
my $Privileged = CheckPermission($In{host});
if ( !$Privileged ) {
- ErrorExit("Only privileged users can view log files.");
+ ErrorExit($Lang->{Only_privileged_users_can_view_log_files});
}
my $host = $In{host};
my($url0, $hdr, $root, $str);
<td> $mtimeStr </td></tr>
EOF
}
- Header("BackupPC: Log File History");
- print <<EOF;
-
-${h1("Log File History $hdr")}
-<p>
-<table border>
-<tr><td align="center"> File </td>
- <td align="center"> Size </td>
- <td align="center"> Modification time </td></tr>
-$str
-</table>
-EOF
+ Header($Lang->{BackupPC__Log_File_History});
+ print (eval("qq{$Lang->{Log_File_History__hdr}}"));
Trailer();
}
my $Privileged = CheckPermission();
if ( !$Privileged ) {
- ErrorExit("Only privileged users can view email summaries." );
+ ErrorExit($Lang->{Only_privileged_users_can_view_email_summaries});
}
GetStatusInfo("hosts");
ReadUserEmailInfo();
foreach my $t ( sort({$b <=> $a} keys(%EmailStr)) ) {
$str .= $EmailStr{$t};
}
- Header("BackupPC: Email Summary");
- print <<EOF;
-${h1("Recent Email Summary (Reverse time order)")}
-<p>
-<table border>
-<tr><td align="center"> Recipient </td>
- <td align="center"> Host </td>
- <td align="center"> Time </td>
- <td align="center"> Subject </td></tr>
-$str
-</table>
-EOF
+ Header($Lang->{Email_Summary});
+ print (eval("qq{$Lang->{Recent_Email_Summary}}"));
Trailer();
}
my $checkBoxCnt = 0; # checkbox counter
if ( !$Privileged ) {
- ErrorExit("Only privileged users can browse backup files"
- . " for host ${EscapeHTML($In{host})}." );
+ ErrorExit(eval("qq{$Lang->{Only_privileged_users_can_browse_backup_files}}"));
}
my $host = $In{host};
my $num = $In{num};
my $dir = $In{dir};
if ( $host eq "" ) {
- ErrorExit("Empty host name.");
+ ErrorExit($Lang->{Empty_host_name});
}
#
# Find the requested backup and the previous filled backup
$mangle = $Backups[$i]{mangle};
if ( $dir eq "" || $dir eq "." || $dir eq ".." ) {
if ( !opendir(DIR, "$TopDir/pc/$host/$num") ) {
- ErrorExit("Can't browse bad directory name"
- . " ${EscapeHTML(\"$TopDir/pc/$host/$num\")}");
+ ErrorExit(eval("qq{$Lang->{Can_t_browse_bad_directory_name}}"));
}
#
# Read this directory and find the first directory
}
closedir(DIR);
if ( $dir eq "" || $dir eq "." || $dir eq ".." ) {
- ErrorExit("Directory ${EscapeHTML(\"$TopDir/pc/$host/$num\")}"
- . " is empty");
+ ErrorExit(eval("qq{$Lang->{Directory___EscapeHTML}}"));
}
}
my $relDir = $dir;
my($fLast, $fum, $fLastum, @DirStr);
if ( $fullDir =~ m{(^|/)\.\.(/|$)} || !opendir(DIR, $fullDir) ) {
- ErrorExit("Can't browse bad directory name"
- . " ${EscapeHTML($fullDir)}");
+ ErrorExit(eval("qq{$Lang->{Can_t_browse_bad_directory_name2}}"));
}
#
# Read this directory and optionally the corresponding filled directory
$dirDisplay =~ s{//}{/}g;
my $filledBackup;
if ( defined($numF) ) {
- $filledBackup = <<EOF;
-<li> This display is merged with backup #$numF, the most recent prior
- filled (full) dump.
-EOF
+ $filledBackup = eval("qq{$Lang->{This_display_is_merged_with_backup}}");
}
- Header("BackupPC: Browse backup $num for $host");
+ Header(eval("qq{$Lang->{Browse_backup__num_for__host}}"));
foreach my $d ( @DirStrPrev ) {
$dirStr .= "<tr><td$d->{tdArgs}>$d->{link}\n";
### hide checkall button if there are no files
my ($topCheckAll, $checkAll, $fileHeader);
if ( $fileStr ) {
- $fileHeader = <<EOF;
- <tr bgcolor="$Conf{CgiHeaderBgColor}"><td align=center> Name</td>
- <td align="center"> Type</td>
- <td align="center"> Mode</td>
- <td align="center"> Size</td>
- <td align="center"> Mod time</td>
- </tr>
-EOF
- $checkAll = <<EOF;
-<tr bgcolor="#ffffcc"><td>
-<input type="checkbox" name="allFiles" onClick="return checkAll('allFiles');"> Select all
-</td><td colspan="4" align="center">
-<input type="submit" name="Submit" value="Restore selected files">
-</td></tr>
-EOF
+ $fileHeader = eval("qq{$Lang->{fileHeader}}");
+
+ $checkAll = $Lang->{checkAll};
+
# and put a checkall box on top if there are at least 20 files
if ( $checkBoxCnt >= 20 ) {
$topCheckAll = $checkAll;
$topCheckAll =~ s{allFiles}{allFilestop}g;
}
} else {
- $fileStr = <<EOF;
-<tr><td bgcolor="#ffffff">The directory ${EscapeHTML($dirDisplay)} is empty
-</td></tr>
-EOF
+ $fileStr = eval("qq{$Lang->{The_directory_is_empty}}");
}
- print <<EOF;
-${h1("Backup browse for $host")}
-
-<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>
-
-<ul>
-<li> You are browsing backup #$num, which started around $backupTime
- ($backupAge days ago),
-$filledBackup
-<li> Click on a directory below to navigate into that directory,
-<li> Click on a file below to restore that file.
-</ul>
-
-${h2("Contents of ${EscapeHTML($dirDisplay)}")}
-<form name="form1" method="post" action="$MyURL">
-<input type="hidden" name="num" value="$num">
-<input type="hidden" name="host" value="$host">
-<input type="hidden" name="fcbMax" value="$checkBoxCnt">
-<input type="hidden" name="action" value="Restore">
-<br>
-<table>
-<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">
- $fileHeader
- $topCheckAll
- $fileStr
- $checkAll
- </table>
- </td></tr></table>
-<br>
-<!--
-This is now in the checkAll row
-<input type="submit" name="Submit" value="Restore selected files">
--->
-</td></tr></table>
-</form>
-EOF
+ print (eval("qq{$Lang->{Backup_browse_for__host}}"));
Trailer();
}
my($str, $reply, $i);
my $Privileged = CheckPermission($In{host});
if ( !$Privileged ) {
- ErrorExit("Only privileged users can restore backup files"
- . " for host ${EscapeHTML($In{host})}." );
+ ErrorExit(eval("qq{$Lang->{Only_privileged_users_can_restore_backup_files}}"));
}
my $host = $In{host};
my $num = $In{num};
ServerConnect();
if ( !defined($Hosts->{$host}) ) {
- ErrorExit("Bad host name ${EscapeHTML($host)}");
+ ErrorExit(eval("qq{$Lang->{Bad_host_name}}"));
}
for ( my $i = 0 ; $i < $In{fcbMax} ; $i++ ) {
next if ( !defined($In{"fcb$i"}) );
$badFileCnt++ if ( $In{pathHdr} =~ m{(^|/)\.\.(/|$)} );
$badFileCnt++ if ( $In{num} =~ m{(^|/)\.\.(/|$)} );
if ( @fileList == 0 ) {
- ErrorExit("You haven't selected any files; please go Back to"
- . " select some files.");
+ ErrorExit($Lang->{You_haven_t_selected_any_files__please_go_Back_to});
}
if ( $badFileCnt ) {
- ErrorExit("Nice try, but you can't put '..' in any of the file names");
+ ErrorExit($Lang->{Nice_try__but_you_can_t_put});
}
if ( @fileList == 1 ) {
$pathHdr =~ s/(.*)\/.*/$1/;
#
# Tell the user what options they have
#
- Header("BackupPC: Restore Options for $host");
- print <<EOF;
-${h1("Restore Options for $host")}
-<p>
-You have selected the following files/directories from
-share $share, backup number #$num:
-<ul>
-$fileListStr
-</ul>
-<p>
-You have three choices for restoring these files/directories.
-Please select one of the following options.
-<p>
-${h2("Option 1: Direct Restore")}
-<p>
-You can start a restore that will restore these files directly onto
-$host.
-<p>
-<b>Warning:</b> any existing files that match the ones you have
-selected will be overwritten!
-
-<form action="$MyURL" method="post">
-<input type="hidden" name="host" value="${EscapeHTML($host)}">
-<input type="hidden" name="num" value="$num">
-<input type="hidden" name="type" value="3">
-$hiddenStr
-<input type="hidden" value="$In{action}" name="action">
-<table border="0">
-<tr>
- <td>Restore the files to host</td>
- <td><input type="text" size="40" value="${EscapeHTML($host)}"
- name="hostDest"></td>
-</tr><tr>
- <td>Restore the files to share</td>
- <td><input type="text" size="40" value="${EscapeHTML($share)}"
- name="shareDest"></td>
-</tr><tr>
- <td>Restore the files below dir<br>(relative to share)</td>
- <td valign="top"><input type="text" size="40" maxlength="256"
- value="${EscapeHTML($pathHdr)}" name="pathHdr"></td>
-</tr><tr>
- <td><input type="submit" value="Start Restore" name=""></td>
-</table>
-</form>
-EOF
+ Header(eval("qq{$Lang->{Restore_Options_for__host}}"));
+ print(eval("qq{$Lang->{Restore_Options_for__host2}}"));
#
# Verify that Archive::Zip is available before showing the
# zip restore option
#
if ( eval { require Archive::Zip } ) {
- print <<EOF;
-
-${h2("Option 2: Download Zip archive")}
-<p>
-You can download a Zip archive containing all the files/directories you have
-selected. You can then use a local application, such as WinZip,
-to view or extract any of the files.
-<p>
-<b>Warning:</b> depending upon which files/directories you have selected,
-this archive might be very very large. It might take many minutes to
-create and transfer the archive, and you will need enough local disk
-space to store it.
-<p>
-<form action="$MyURL" method="post">
-<input type="hidden" name="host" value="${EscapeHTML($host)}">
-<input type="hidden" name="num" value="$num">
-<input type="hidden" name="type" value="2">
-$hiddenStr
-<input type="hidden" value="$In{action}" name="action">
-<input type="checkbox" value="1" name="relative" checked> Make archive relative
-to ${EscapeHTML($pathHdr eq "" ? "/" : $pathHdr)}
-(otherwise archive will contain full paths).
-<br>
-Compression (0=off, 1=fast,...,9=best)
-<input type="text" size="6" value="5" name="compressLevel">
-<br>
-<input type="submit" value="Download Zip File" name="">
-</form>
-EOF
+ print (eval("qq{$Lang->{Option_2__Download_Zip_archive}}"));
} else {
- print <<EOF;
-
-${h2("Option 2: Download Zip archive")}
-<p>
-You could download a zip archive, but Archive::Zip is not installed.
-Please ask your system adminstrator to install Archive::Zip from
-<a href="http://www.cpan.org">www.cpan.org</a>.
-<p>
-EOF
+ print (eval("qq{$Lang->{Option_2__Download_Zip_archive2}}"));
}
- print <<EOF;
-${h2("Option 3: Download Tar archive")}
-<p>
-You can download a Tar archive containing all the files/directories you
-have selected. You can then use a local application, such as tar or
-WinZip to view or extract any of the files.
-<p>
-<b>Warning:</b> depending upon which files/directories you have selected,
-this archive might be very very large. It might take many minutes to
-create and transfer the archive, and you will need enough local disk
-space to store it.
-<p>
-<form action="$MyURL" method="post">
-<input type="hidden" name="host" value="${EscapeHTML($host)}">
-<input type="hidden" name="num" value="$num">
-<input type="hidden" name="type" value="1">
-$hiddenStr
-<input type="hidden" value="$In{action}" name="action">
-<input type="checkbox" value="1" name="relative" checked> Make archive relative
-to ${EscapeHTML($pathHdr eq "" ? "/" : $pathHdr)}
-(otherwise archive will contain full paths).
-<br>
-<input type="submit" value="Download Tar File" name="">
-</form>
-EOF
+ print (eval("qq{$Lang->{Option_3__Download_Zip_archive}}"));
Trailer();
} elsif ( $In{type} == 1 ) {
#
$SIG{CHLD} = 'IGNORE';
my $pid = fork();
if ( !defined($pid) ) {
- $bpc->ServerMesg("log Can't fork for tar restore request by $User");
- ErrorExit("Can't fork for tar restore");
+ $bpc->ServerMesg(eval("qq{$Lang->{log_Can_t_fork_for_tar_restore_request_by__User}}"));
+ ErrorExit($Lang->{Can_t_fork_for_tar_restore});
}
if ( $pid ) {
#
if ( @fileListTrim > 10 ) {
@fileListTrim = (@fileListTrim[0..9], '...');
}
- $bpc->ServerMesg("log User $User downloaded tar archive for $host,"
- . " backup $num; files were: "
- . join(", ", @fileListTrim));
+ $bpc->ServerMesg(eval("qq{$Lang->{log_User__User_downloaded_tar_archive_for__host}}"));
return;
}
#
$SIG{CHLD} = 'IGNORE';
my $pid = fork();
if ( !defined($pid) ) {
- $bpc->ServerMesg("log Can't fork for zip restore request by $User");
- ErrorExit("Can't fork for zip restore");
+ $bpc->ServerMesg(eval("qq{$Lang->{log_Can_t_fork_for_zip_restore_request_by__User}}"));
+ ErrorExit($Lang->{Can_t_fork_for_zip_restore});
}
if ( $pid ) {
#
if ( @fileListTrim > 10 ) {
@fileListTrim = (@fileListTrim[0..9], '...');
}
- $bpc->ServerMesg("log User $User downloaded zip archive for $host,"
- . " backup $num; files were: "
- . join(", ", @fileListTrim));
+ $bpc->ServerMesg(eval("qq{$Lang->{log_User__User_downloaded_zip_archive_for__host}}"));
return;
}
#
# Do restore directly onto host
#
if ( !defined($Hosts->{$In{hostDest}}) ) {
- ErrorExit("Host ${EscapeHTML($In{hostDest})} doesn't exist");
+ ErrorExit(eval("qq{$Lang->{Host__doesn_t_exist}}"));
}
if ( !CheckPermission($In{hostDest}) ) {
- ErrorExit("You don't have permission to restore onto host"
- . " ${EscapeHTML($In{hostDest})}");
+ ErrorExit(eval("qq{$Lang->{You_don_t_have_permission_to_restore_onto_host}}"));
}
$fileListStr = "";
foreach my $f ( @fileList ) {
<tr><td>$host:/$strippedShare$f</td><td>$In{hostDest}:/$strippedShareDest$targetFile</td></tr>
EOF
}
- Header("BackupPC: Restore Confirm on $host");
- print <<EOF;
-${h1("Are you sure?")}
-<p>
-You are about to start a restore directly to the machine $In{hostDest}.
-The following files will be restored to share $In{shareDest}, from
-backup number $num:
-<p>
-<table border>
-<tr><td>Original file/dir</td><td>Will be restored to</td></tr>
-$fileListStr
-</table>
-
-<form action="$MyURL" method="post">
-<input type="hidden" name="host" value="${EscapeHTML($host)}">
-<input type="hidden" name="hostDest" value="${EscapeHTML($In{hostDest})}">
-<input type="hidden" name="shareDest" value="${EscapeHTML($In{shareDest})}">
-<input type="hidden" name="pathHdr" value="${EscapeHTML($In{pathHdr})}">
-<input type="hidden" name="num" value="$num">
-<input type="hidden" name="type" value="4">
-$hiddenStr
-Do you really want to do this?
-<input type="submit" value="$In{action}" name="action">
-<input type="submit" value="No" name="">
-</form>
-EOF
+ Header(eval("qq{$Lang->{Restore_Confirm_on__host}}"));
+ print(eval("qq{$Lang->{Are_you_sure}}"));
Trailer();
} elsif ( $In{type} == 4 ) {
if ( !defined($Hosts->{$In{hostDest}}) ) {
- ErrorExit("Host ${EscapeHTML($In{hostDest})} doesn't exist");
+ ErrorExit(eval("qq{$Lang->{Host_doesn_t_exist}}"));
}
if ( !CheckPermission($In{hostDest}) ) {
- ErrorExit("You don't have permission to restore onto host"
- . " ${EscapeHTML($In{hostDest})}");
+ ErrorExit(eval("qq{$Lang->{You_don_t_have_permission_to_restore_onto_host}}"));
}
my $hostDest = $1 if ( $In{hostDest} =~ /(.+)/ );
my $ipAddr = ConfirmIPAddress($hostDest);
print(REQ $dump->Dump);
close(REQ);
} else {
- ErrorExit("Can't open/create "
- . ${EscapeHTML("$TopDir/pc/$hostDest/$reqFileName")});
+ ErrorExit(eval("qq{$Lang->{Can_t_open_create}}"));
}
- $reply = $bpc->ServerMesg("restore $ipAddr"
- . " $hostDest $User $reqFileName");
- $str = "Restore requested to host $hostDest, backup #$num,"
- . " by $User from $ENV{REMOTE_ADDR}";
- Header("BackupPC: Restore Requested on $hostDest");
- print <<EOF;
-${h1($str)}
-<p>
-Reply from server was: $reply
-<p>
-Go back to <a href="$MyURL?host=$hostDest">$hostDest home page</a>.
-EOF
+ $reply = $bpc->ServerMesg(eval("qq{$Lang->{restore__ipAddr}}"));
+ $str = eval("qq{$Lang->{Restore_requested_to_host__hostDest__backup___num}}");
+ Header(eval("qq{$Lang->{Restore_Requested_on__hostDest}}"));
+ print (eval("qq{$Lang->{Reply_from_server_was___reply}}"));
Trailer();
}
}
};
if ( !$Privileged ) {
- ErrorExit("Only privileged users can restore backup files"
- . " for host ${EscapeHTML($host)}." );
+ ErrorExit(eval("qq{$Lang->{Only_privileged_users_can_restore_backup_files2}}"));
}
ServerConnect();
my @Backups = $bpc->BackupInfoRead($host);
if ( $host eq "" ) {
- ErrorExit("Empty host name");
+ ErrorExit($Lang->{Empty_host_name});
}
$dir = "/" if ( $dir eq "" );
for ( $i = 0 ; $i < @Backups ; $i++ ) {
}
}
if ( $fullPath =~ m{(^|/)\.\.(/|$)} || !-f $fullPath ) {
- ErrorExit("Can't restore bad file ${EscapeHTML($fullPath)}");
+ ErrorExit(eval("qq{$Lang->{Can_t_restore_bad_file}}"));
}
my $dirUM = $mangle ? $bpc->fileNameUnmangle($dir) : $dir;
my $attr = BackupPC::Attrib->new({compress => $compress});
}
}
CheckPermission();
- ErrorExit("Unknown host or user ${EscapeHTML($host)}")
+ ErrorExit(eval("qq{$Lang->{Unknown_host_or_user}}"))
if ( !defined($Hosts->{$host}) );
}
$In{host} = $host;
%Conf = $bpc->Conf();
my $Privileged = CheckPermission($host);
if ( !$Privileged ) {
- ErrorExit("Only privileged users can view information about"
- . " host ${EscapeHTML($host)}." );
+ ErrorExit(eval("qq{$Lang->{Only_privileged_users_can_view_information_about}}"));
}
ReadUserEmailInfo();
}
my $age = sprintf("%.1f", (time - $Backups[$i]{startTime}) / (24*3600));
my $browseURL = "$MyURL?action=browse&host=$host&num=$Backups[$i]{num}";
- my $filled = $Backups[$i]{noFill} ? "no" : "yes";
+ my $filled = $Backups[$i]{noFill} ? $Lang->{No} : $Lang->{Yes};
$filled .= " ($Backups[$i]{fillFromNum}) "
if ( $Backups[$i]{fillFromNum} ne "" );
+ my $ltype;
+ if ($Backups[$i]{type} eq "full") { $ltype = $Lang->{full}; }
+ else { $ltype = $Lang->{incremental}; }
$str .= <<EOF;
<tr><td align="center"> <a href="$browseURL">$Backups[$i]{num}</a> </td>
- <td align="center"> $Backups[$i]{type} </td>
+ <td align="center"> $ltype </td>
<td align="center"> $filled </td>
<td align="right"> $startTime </td>
<td align="right"> $duration </td>
EOF
$sizeStr .= <<EOF;
<tr><td align="center"> <a href="$browseURL">$Backups[$i]{num}</a> </td>
- <td align="center"> $Backups[$i]{type} </td>
+ <td align="center"> $ltype </td>
<td align="right"> $Backups[$i]{nFiles} </td>
<td align="right"> $MB </td>
<td align="right"> $MBperSec </td>
</tr>
EOF
$Backups[$i]{compress} ||= "off";
+ my $is_compress = $Lang->{off};
+ if ($Backups[$i]{compress} ne "off") {$is_compress = $Lang->{on}; }
+ if (! $ExistComp) { $ExistComp = " "; }
+ if (! $MBExistComp) { $MBExistComp = " "; }
$compStr .= <<EOF;
<tr><td align="center"> <a href="$browseURL">$Backups[$i]{num}</a> </td>
- <td align="center"> $Backups[$i]{type} </td>
- <td align="center"> $Backups[$i]{compress} </td>
+ <td align="center"> $ltype </td>
+ <td align="center"> $is_compress </td>
<td align="right"> $MBExist </td>
- <td align="right"> $MBExistComp </td>
- <td align="right"> $ExistComp </td>
+ <td align="right"> $MBExistComp </td>
+ <td align="right"> $ExistComp </td>
<td align="right"> $MBNew </td>
<td align="right"> $MBNewComp </td>
<td align="right"> $NewComp </td>
EOF
$errStr .= <<EOF;
<tr><td align="center"> <a href="$browseURL">$Backups[$i]{num}</a> </td>
- <td align="center"> $Backups[$i]{type} </td>
+ <td align="center"> $ltype </td>
<td align="center"> <a href="$MyURL?action=view&type=XferLOG&num=$Backups[$i]{num}&host=$host">XferLOG</a>,
<a href="$MyURL?action=view&type=XferErr&num=$Backups[$i]{num}&host=$host">Errors</a> </td>
<td align="right"> $Backups[$i]{xferErrs} </td>
my $duration = sprintf("%.1f", $dur / 60);
my $MB = sprintf("%.1f", $Restores[$i]{size} / (1024*1024));
my $MBperSec = sprintf("%.2f", $Restores[$i]{size} / (1024*1024*$dur));
+ my $Restores_Result = $Lang->{failed};
+ if ($Restores[$i]{result} ne "failed") { $Restores_Result = $Lang->{success}; }
$restoreStr .= <<EOF;
<tr><td align="center"><a href="$MyURL?action=restoreInfo&num=$Restores[$i]{num}&host=$host">$Restores[$i]{num}</a> </td>
- <td align="center"> $Restores[$i]{result} </td>
+ <td align="center"> $Restores_Result </td>
<td align="right"> $startTime </td>
<td align="right"> $duration </td>
<td align="right"> $Restores[$i]{nFiles} </td>
</tr>
EOF
}
- $restoreStr = <<EOF if ( $restoreStr ne "" );
-${h2("Restore Summary")}
-<p>
-Click on the restore number for more details.
-<table border>
-<tr><td align="center"> Restore# </td>
- <td align="center"> Result </td>
- <td align="right"> Start Date</td>
- <td align="right"> Dur/mins</td>
- <td align="right"> #files </td>
- <td align="right"> MB </td>
- <td align="right"> #tar errs </td>
- <td align="right"> #xferErrs </td>
-</tr>
-$restoreStr
-</table>
-<p>
-EOF
-
+ if ( $restoreStr ne "" ) {
+ $restoreStr = eval("qq{$Lang->{Restore_Summary}}");
+ }
if ( @Backups == 0 ) {
- $warnStr = "<h2> This PC has never been backed up!! </h2>\n";
+ $warnStr = $Lang->{This_PC_has_never_been_backed_up};
}
if ( defined($Hosts->{$host}) ) {
my $user = $Hosts->{$host}{user};
+ my @moreUsers = sort(keys(%{$Hosts->{$host}{moreUsers}}));
+ my $moreUserStr;
+ foreach my $u ( sort(keys(%{$Hosts->{$host}{moreUsers}})) ) {
+ $moreUserStr .= ", " if ( $moreUserStr ne "" );
+ $moreUserStr .= "${UserLink($u)}";
+ }
+ if ( $moreUserStr ne "" ) {
+ $moreUserStr = " ($Lang->{and} $moreUserStr).\n";
+ } else {
+ $moreUserStr = ".\n";
+ }
if ( $user ne "" ) {
- $statusStr .= <<EOF;
-<li>This PC is used by ${UserLink($user)}.
-EOF
+ $statusStr .= eval("qq{$Lang->{This_PC_is_used_by}$moreUserStr}");
}
if ( defined($UserEmailInfo{$user})
&& $UserEmailInfo{$user}{lastHost} eq $host ) {
my $mailTime = timeStamp2($UserEmailInfo{$user}{lastTime});
my $subj = $UserEmailInfo{$user}{lastSubj};
- $statusStr .= <<EOF;
-<li>Last email sent to ${UserLink($user)} was at $mailTime, subject "$subj".
-EOF
+ $statusStr .= eval("qq{$Lang->{Last_email_sent_to__was_at___subject}}");
}
}
if ( defined($Jobs{$host}) ) {
my $startTime = timeStamp2($Jobs{$host}{startTime});
(my $cmd = $Jobs{$host}{cmd}) =~ s/$BinDir\///g;
- $statusStr .= <<EOF;
-<li>The command $cmd is currently running for $host, started $startTime.
-EOF
+ $statusStr .= eval("qq{$Lang->{The_command_cmd_is_currently_running_for_started}}");
}
if ( $StatusHost{BgQueueOn} ) {
- $statusStr .= <<EOF;
-<li>Host $host is queued on the background queue (will be backed up soon).
-EOF
+ $statusStr .= eval("qq{$Lang->{Host_host_is_queued_on_the_background_queue_will_be_backed_up_soon}}");
}
if ( $StatusHost{UserQueueOn} ) {
- $statusStr .= <<EOF;
-<li>Host $host is queued on the user queue (will be backed up soon).
-EOF
+ $statusStr .= eval("qq{$Lang->{Host_host_is_queued_on_the_user_queue__will_be_backed_up_soon}}");
}
if ( $StatusHost{CmdQueueOn} ) {
- $statusStr .= <<EOF;
-<li>A command for $host is on the command queue (will run soon).
-EOF
+ $statusStr .= eval("qq{$Lang->{A_command_for_host_is_on_the_command_queue_will_run_soon}}");
}
my $startTime = timeStamp2($StatusHost{endTime} == 0 ?
$StatusHost{startTime} : $StatusHost{endTime});
if ( $StatusHost{reason} ne "" ) {
$reason = " ($StatusHost{reason})";
}
- $statusStr .= <<EOF;
-<li>Last status is state "$StatusHost{state}"$reason
- as of $startTime.
-EOF
+ $statusStr .= eval("qq{$Lang->{Last_status_is_state_StatusHost_state_reason_as_of_startTime}}");
+
if ( $StatusHost{error} ne "" ) {
- $statusStr .= <<EOF;
-<li>Last error is "${EscapeHTML($StatusHost{error})}"
-EOF
+ $statusStr .= eval("qq{$Lang->{Last_error_is____EscapeHTML_StatusHost_error}}");
}
my $priorStr = "Pings";
if ( $StatusHost{deadCnt} > 0 ) {
- $statusStr .= <<EOF;
-<li>Pings to $host have failed $StatusHost{deadCnt} consecutive times.
-EOF
- $priorStr = "Prior to that, pings";
+ $statusStr .= eval("qq{$Lang->{Pings_to_host_have_failed_StatusHost_deadCnt__consecutive_times}}");
+ $priorStr = $Lang->{Prior_to_that__pings};
}
if ( $StatusHost{aliveCnt} > 0 ) {
- $statusStr .= <<EOF;
-<li>$priorStr to $host have succeeded $StatusHost{aliveCnt}
- consecutive times.
-EOF
+ $statusStr .= eval("qq{$Lang->{priorStr_to_host_have_succeeded_StatusHostaliveCnt_consecutive_times}}");
+
if ( $StatusHost{aliveCnt} >= $Conf{BlackoutGoodCnt}
&& $Conf{BlackoutGoodCnt} >= 0 && $Conf{BlackoutHourBegin} >= 0
&& $Conf{BlackoutHourEnd} >= 0 ) {
my($t1) = sprintf("%d:%02d", $Conf{BlackoutHourEnd},
60 * ($Conf{BlackoutHourEnd}
- int($Conf{BlackoutHourEnd})));
- $statusStr .= <<EOF;
-<li>Because $host has been on the network at least $Conf{BlackoutGoodCnt}
-consecutive times, it will not be backed up from $t0 to $t1 on $days.
-EOF
+ $statusStr .= eval("qq{$Lang->{Because__host_has_been_on_the_network_at_least__Conf_BlackoutGoodCnt_consecutive_times___}}");
}
}
if ( $StatusHost{backoffTime} > time ) {
my $hours = sprintf("%.1f", ($StatusHost{backoffTime} - time) / 3600);
- $statusStr .= <<EOF;
-<li>Backups are deferred for $hours hours
- (<a href="$MyURL?action=Stop/Dequeue%20Backup&host=$host">change this
- number</a>).
-EOF
+ $statusStr .= eval("qq{$Lang->{Backups_are_deferred_for_hours_hours_change_this_number}}");
+
}
if ( @Backups ) {
# only allow incremental if there are already some backups
$startIncrStr = <<EOF;
-<input type="submit" value="Start Incr Backup" name="action">
+<input type="submit" value="\$Lang->{Start_Incr_Backup}" name="action">
EOF
}
- Header("BackupPC: Host $host Backup Summary");
- print <<EOF;
-${h1("Host $host Backup Summary")}
-<p>
-$warnStr
-<ul>
-$statusStr
-</ul>
+ $startIncrStr = eval ("qq{$startIncrStr}");
-${h2("User Actions")}
-<p>
-<form action="$MyURL" method="get">
-<input type="hidden" name="host" value="$host">
-$startIncrStr
-<input type="submit" value="Start Full Backup" name="action">
-<input type="submit" value="Stop/Dequeue Backup" name="action">
-</form>
-
-${h2("Backup Summary")}
-<p>
-Click on the backup number to browse and restore backup files.
-<table border>
-<tr><td align="center"> Backup# </td>
- <td align="center"> Type </td>
- <td align="center"> Filled </td>
- <td align="center"> Start Date </td>
- <td align="center"> Duration/mins </td>
- <td align="center"> Age/days </td>
- <td align="center"> Server Backup Path </td>
-</tr>
-$str
-</table>
-<p>
-
-$restoreStr
-
-${h2("Xfer Error Summary")}
-<p>
-<table border>
-<tr><td align="center"> Backup# </td>
- <td align="center"> Type </td>
- <td align="center"> View </td>
- <td align="center"> #Xfer errs </td>
- <td align="center"> #bad files </td>
- <td align="center"> #bad share </td>
- <td align="center"> #tar errs </td>
-</tr>
-$errStr
-</table>
-<p>
-
-${h2("File Size/Count Reuse Summary")}
-<p>
-Existing files are those already in the pool; new files are those added
-to the pool.
-Empty files and SMB errors aren't counted in the reuse and new counts.
-<table border>
-<tr><td colspan="2"></td>
- <td align="center" colspan="3"> Totals </td>
- <td align="center" colspan="2"> Existing Files </td>
- <td align="center" colspan="2"> New Files </td>
-</tr>
-<tr>
- <td align="center"> Backup# </td>
- <td align="center"> Type </td>
- <td align="center"> #Files </td>
- <td align="center"> Size/MB </td>
- <td align="center"> MB/sec </td>
- <td align="center"> #Files </td>
- <td align="center"> Size/MB </td>
- <td align="center"> #Files </td>
- <td align="center"> Size/MB </td>
-</tr>
-$sizeStr
-</table>
-<p>
-
-${h2("Compression Summary")}
-<p>
-Compression performance for files already in the pool and newly
-compressed files.
-<table border>
-<tr><td colspan="3"></td>
- <td align="center" colspan="3"> Existing Files </td>
- <td align="center" colspan="3"> New Files </td>
-</tr>
-<tr><td align="center"> Backup# </td>
- <td align="center"> Type </td>
- <td align="center"> Comp Level </td>
- <td align="center"> Size/MB </td>
- <td align="center"> Comp/MB </td>
- <td align="center"> Comp </td>
- <td align="center"> Size/MB </td>
- <td align="center"> Comp/MB </td>
- <td align="center"> Comp </td>
-</tr>
-$compStr
-</table>
-<p>
-EOF
+ Header(eval("qq{$Lang->{Host__host_Backup_Summary}}"));
+ print(eval("qq{$Lang->{Host__host_Backup_Summary2}}"));
Trailer();
}
sub Action_GeneralInfo
{
- GetStatusInfo("info jobs hosts queueLen");
+ GetStatusInfo($Lang->{info_jobs_hosts_queueLen});
my $Privileged = CheckPermission();
my($jobStr, $statusStr, $tarPidHdr, $ rivLinks);
} elsif ( $Info{cpoolFileCnt} > 0 ) {
$poolInfo = $cpoolInfo;
}
- Header("BackupPC: Server Status");
- print <<EOF;
-${h1("BackupPC Server Status")}
-<p>
+ Header($Lang->{H_BackupPC_Server_Status});
+ #Header("H_BackupPC_Server_Status");
+ print (eval ("qq{$Lang->{BackupPC_Server_Status}}"));
-${h2("General Server Information")}
+ #Header($Lang->{BackupPC_Server_Status});
-<ul>
-<li> The server's PID is $Info{pid} on host $Conf{ServerHost},
- version $Info{Version}, started at $serverStartTime.
-<li> This status was generated at $now.
-<li> PCs will be next queued at $nextWakeupTime.
-<li> Other info:
- <ul>
- <li>$numBgQueue pending backup requests from last scheduled wakeup,
- <li>$numUserQueue pending user backup requests,
- <li>$numCmdQueue pending command requests,
- $poolInfo
- <li>Pool file system was recently at $Info{DUlastValue}%
- ($DUlastTime), today's max is $Info{DUDailyMax}% ($DUmaxTime)
- and yesterday's max was $Info{DUDailyMaxPrev}%.
- </ul>
-</ul>
-
-${h2("Currently Running Jobs")}
-<p>
-<table border>
-<tr><td> Host </td>
- <td> Type </td>
- <td> User </td>
- <td> Start Time </td>
- <td> Command </td>
- <td align="center"> PID </td>
- <td> Xfer PID </td>
- $tarPidHdr</tr>
-$jobStr
-</table>
-<p>
-
-${h2("Failures that need attention")}
-<p>
-<table border>
-<tr><td align="center"> Host </td>
- <td align="center"> Type </td>
- <td align="center"> User </td>
- <td align="center"> Last Try </td>
- <td align="center"> Details </td>
- <td align="center"> Error Time </td>
- <td> Last error (other than no ping) </td></tr>
-$statusStr
-</table>
-EOF
+ #my $trans_text = $Lang->{BackupPC_Server_Status};
+ #print eval ("qq{$trans_text}");
Trailer();
}
my $i;
if ( !$Privileged ) {
- ErrorExit("Only privileged users can view restore information." );
+ ErrorExit($Lang->{Only_privileged_users_can_view_restore_information});
}
#
# Find the requested restore
last if ( $Restores[$i]{num} == $num );
}
if ( $i >= @Restores ) {
- ErrorExit("Restore number $num for host ${EscapeHTML($host)} does"
- . " not exist.");
+ ErrorExit(eval("qq{$Lang->{Restore_number__num_for_host__does_not_exist}}"));
}
%RestoreReq = ();
EOF
}
- Header("BackupPC: Restore #$num details for $host");
- print <<EOF;
-${h1("Restore #$num Details for $host")}
-<p>
-<table border>
-<tr><td> Number </td><td> $Restores[$i]{num} </td></tr>
-<tr><td> Requested by </td><td> $RestoreReq{user} </td></tr>
-<tr><td> Request time </td><td> $reqTime </td></tr>
-<tr><td> Result </td><td> $Restores[$i]{result} </td></tr>
-<tr><td> Error Message </td><td> $Restores[$i]{errorMsg} </td></tr>
-<tr><td> Source host </td><td> $RestoreReq{hostSrc} </td></tr>
-<tr><td> Source backup num </td><td> $RestoreReq{num} </td></tr>
-<tr><td> Source share </td><td> $RestoreReq{shareSrc} </td></tr>
-<tr><td> Destination host </td><td> $RestoreReq{hostDest} </td></tr>
-<tr><td> Destination share </td><td> $RestoreReq{shareDest} </td></tr>
-<tr><td> Start time </td><td> $startTime </td></tr>
-<tr><td> Duration </td><td> $duration min </td></tr>
-<tr><td> Number of files </td><td> $Restores[$i]{nFiles} </td></tr>
-<tr><td> Total size </td><td> ${MB} MB </td></tr>
-<tr><td> Transfer rate </td><td> $MBperSec MB/sec </td></tr>
-<tr><td> TarCreate errors </td><td> $Restores[$i]{tarCreateErrs} </td></tr>
-<tr><td> Xfer errors </td><td> $Restores[$i]{xferErrs} </td></tr>
-<tr><td> Xfer log file </td><td>
-<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>
-${h1("File/Directory list")}
-<p>
-<table border>
-<tr><td>Original file/dir</td><td>Restored to</td></tr>
-$fileListStr
-</table>
-EOF
+ Header(eval("qq{$Lang->{Restore___num_details_for__host}}"));
+ print(eval("qq{$Lang->{Restore___num_details_for__host2 }}"));
Trailer();
}
$s =~ s/\"/"/g;
$s =~ s/>/>/g;
$s =~ s/</</g;
- $s =~ s{([^[:print:]])}{sprintf("&#x%02X;", ord($1));}eg;
+ $s =~ s{([^[:print:]])}{sprintf("&\#x%02X", ord($1));}eg;
return \$s;
}
$bpc->ServerMesg("log User $User (host=$In{host}) got CGI error: $head")
if ( defined($bpc) );
- Header("BackupPC: Error");
- print <<EOF;
-${h1("Error: $head")}
+ if ( !defined($Lang->{Error}) ) {
+ Header("BackupPC: Error");
+ print <<EOF;
+${h1("Error: Language strings not defined!!")}
<p>$mesg</p>
EOF
- Trailer();
+ Trailer();
+ } else {
+ Header(eval("qq{$Lang->{Error}}"));
+ print (eval("qq{$Lang->{Error____head}}"));
+ Trailer();
+ }
exit(1);
}
return if ( $bpc->ServerOK() );
$bpc->ServerDisconnect();
if ( my $err = $bpc->ServerConnect($Conf{ServerHost}, $Conf{ServerPort}) ) {
- ErrorExit(
- "Unable to connect to BackupPC server",
- "This CGI script ($MyURL) is unable to connect to the BackupPC"
- . " server on $Conf{ServerHost} port $Conf{ServerPort}. The error"
- . " was: $err.",
- "Perhaps the BackupPC server is not running or there is a "
- . " configuration error. Please report this to your Sys Admin."
- );
+ ErrorExit(eval("qq{$Lang->{Unable_to_connect_to_BackupPC_server}}"));
}
}
}
$PrivAdmin = $Privileged;
$Privileged ||= $User eq $Hosts->{$host}{user};
+ $Privileged ||= defined($Hosts->{$host}{operators}{$User});
+
return $Privileged;
}
+#
+# Returns the list of hosts that should appear in the navigation bar
+# for this user. If $Conf{CgiNavBarAdminAllHosts} is set, the admin
+# gets all the hosts. Otherwise, regular users get hosts for which
+# they are the user or are listed in the moreUsers column in the
+# hosts file.
+#
+sub GetUserHosts
+{
+ if ( $Conf{CgiNavBarAdminAllHosts} && CheckPermission() ) {
+ return sort keys %$Hosts;
+ }
+
+ return sort grep { $Hosts->{$_}{user} eq $User ||
+ defined($Hosts->{$_}{moreUsers}{$User}) } keys(%$Hosts);
+}
+
#
# Given a host name tries to find the IP address. For non-dhcp hosts
# we just return the host name. For dhcp hosts we check the address
GetStatusInfo("host($host)");
if ( defined($StatusHost{dhcpHostIP})
&& $StatusHost{dhcpHostIP} ne $ipAddr ) {
- $tryIP = " and $StatusHost{dhcpHostIP}";
+ $tryIP = eval("qq{$Lang->{tryIP}}");
($netBiosHost, $netBiosUser)
= $bpc->NetBiosInfoGet($StatusHost{dhcpHostIP});
}
if ( $netBiosHost ne $host ) {
- ErrorExit("Can't find IP address for ${EscapeHTML($host)}",
- <<EOF);
-$host is a DHCP host, and I don't know its IP address. I checked the
-netbios name of $ENV{REMOTE_ADDR}$tryIP, and found that that machine
-is not $host.
-<p>
-Until I see $host at a particular DHCP address, you can only
-start this request from the client machine itself.
-EOF
+ ErrorExit(eval("qq{$Lang->{Can_t_find_IP_address_for}}"),
+ eval("qq{$Lang->{host_is_a_DHCP_host}}"));
}
$ipAddr = $StatusHost{dhcpHostIP};
}
my $poolRmSize = sprintf("%.2f", $info->{"${name}KbRm"} / (1000 * 1024));
my $poolTime = timeStamp2($info->{"${name}Time"});
$info->{"${name}FileCntRm"} = $info->{"${name}FileCntRm"} + 0;
- return <<EOF;
- <li>Pool is ${poolSize}GB comprising $info->{"${name}FileCnt"} files
- and $info->{"${name}DirCnt"} directories (as of $poolTime),
- <li>Pool hashing gives $info->{"${name}FileCntRep"} repeated
- files with longest chain $info->{"${name}FileRepMax"},
- <li>Nightly cleanup removed $info->{"${name}FileCntRm"} files of
- size ${poolRmSize}GB (around $poolTime),
-EOF
+ return eval("qq{$Lang->{Pool_Stat}}");
+
}
###########################################################################
{
my($title) = @_;
my @adminLinks = (
- { link => "", name => "Status",
+ { link => "", name => $Lang->{Status},
priv => 1},
- { link => "?action=summary", name => "PC Summary" },
- { link => "?action=view&type=LOG", name => "LOG file" },
- { link => "?action=LOGlist", name => "Old LOGs" },
- { link => "?action=emailSummary", name => "Email summary" },
- { link => "?action=view&type=config", name => "Config file" },
- { link => "?action=view&type=hosts", name => "Hosts file" },
- { link => "?action=queue", name => "Current queues" },
- { link => "?action=view&type=docs", name => "Documentation",
+ { link => "?action=summary", name => $Lang->{PC_Summary} },
+ { link => "?action=view&type=LOG", name => $Lang->{LOG_file} },
+ { link => "?action=LOGlist", name => $Lang->{Old_LOGs} },
+ { link => "?action=emailSummary", name => $Lang->{Email_summary} },
+ { link => "?action=view&type=config", name => $Lang->{Config_file} },
+ { link => "?action=view&type=hosts", name => $Lang->{Hosts_file} },
+ { link => "?action=queue", name => $Lang->{Current_queues} },
+ { link => "?action=view&type=docs", name => $Lang->{Documentation},
priv => 1},
{ link => "http://backuppc.sourceforge.net", name => "SourceForge",
priv => 1},
print " \n";
if ( defined($In{host}) && defined($Hosts->{$In{host}}) ) {
my $host = $In{host};
- NavSectionTitle("Host $In{host}");
+ NavSectionTitle( eval("qq{$Lang->{Host_Inhost}}") );
NavSectionStart();
- NavLink("?host=$host", "Home");
- NavLink("?action=view&type=LOG&host=$host", "LOG file");
- NavLink("?action=LOGlist&host=$host", "Old LOGs");
+ NavLink("?host=$host", $Lang->{Home});
+ NavLink("?action=view&type=LOG&host=$host", $Lang->{LOG_file});
+ NavLink("?action=LOGlist&host=$host", $Lang->{Old_LOGs});
if ( -f "$TopDir/pc/$host/SmbLOG.bad"
|| -f "$TopDir/pc/$host/SmbLOG.bad.z"
|| -f "$TopDir/pc/$host/XferLOG.bad"
|| -f "$TopDir/pc/$host/XferLOG.bad.z" ) {
NavLink("?action=view&type=XferLOGbad&host=$host",
- "Last bad XferLOG");
+ $Lang->{Last_bad_XferLOG});
NavLink("?action=view&type=XferErrbad&host=$host",
- "Last bad XferLOG (errors only)");
+ $Lang->{Last_bad_XferLOG_errors_only});
}
if ( -f "$TopDir/pc/$host/config.pl" ) {
- NavLink("?action=view&type=config&host=$host", "Config file");
+ NavLink("?action=view&type=config&host=$host", $Lang->{Config_file});
}
NavSectionEnd();
}
- NavSectionTitle("Hosts");
- if ( %$Hosts > 0 ) {
- NavSectionStart();
- foreach my $host ( sort(keys(%$Hosts)) ) {
- next if ( $Hosts->{$host}{user} ne $User );
+ NavSectionTitle($Lang->{Hosts});
+ if ( defined($Hosts) && %$Hosts > 0 ) {
+ NavSectionStart(0);
+ foreach my $host ( GetUserHosts() ) {
NavLink("?host=$host", $host);
}
NavSectionEnd();
}
print <<EOF;
<table cellpadding="2" cellspacing="0" border="0" width="100%">
- <tr><td><small>Host or User name:</small></td>
+ <tr><td>$Lang->{Host_or_User_name}</td>
<tr><td><form action="$MyURL" method="get"><small>
<input type="text" name="host" size="10" maxlength="64">
- <input type="hidden" name="action" value="hostInfo"><input type="submit" value="Go" name="ignore">
+ <input type="hidden" name="action" value="$Lang->{hostInfo}"><input type="submit" value="$Lang->{Go}" name="ignore">
</small></form></td></tr>
</table>
EOF
- NavSectionTitle("Server");
+ NavSectionTitle($Lang->{NavSectionTitle_});
NavSectionStart();
foreach my $l ( @adminLinks ) {
if ( $PrivAdmin || $l->{priv} ) {
EOF
}
-sub h1
-{
- my($str) = @_;
- return \<<EOF;
-<table cellpadding="2" cellspacing="0" border="0" width="100%">
-<tr>
-<td bgcolor="$Conf{CgiHeaderBgColor}"> <font face="$Conf{CgiHeaderFontType}"
- size="$Conf{CgiHeaderFontSize}"><b>$str</b></font>
-</td></tr>
-</table>
-EOF
-}
-
-sub h2
-{
- my($str) = @_;
- return \<<EOF;
-<table cellpadding="2" cellspacing="0" border="0" width="100%">
-<tr>
-<td bgcolor="$Conf{CgiHeaderBgColor}"> <font face="$Conf{CgiHeaderFontType}"
- size="$Conf{CgiHeaderFontSize}"><b>$str</b></font>
-</td></tr>
-</table>
-EOF
-}
sub NavSectionTitle
{
sub NavSectionStart
{
+ my($padding) = @_;
+
+ $padding = 2 if ( !defined($padding) );
print <<EOF;
-<table cellpadding="2" cellspacing="0" border="0" width="100%">
+<table cellpadding="$padding" cellspacing="0" border="0" width="100%">
EOF
}
EOF
}
}
+
+sub h1
+{
+ my($str) = @_;
+ return \<<EOF;
+<table cellpadding="2" cellspacing="0" border="0" width="100%">
+<tr>
+<td bgcolor="$Conf{CgiHeaderBgColor}"> <font face="$Conf{CgiHeaderFontType}"
+ size="$Conf{CgiHeaderFontSize}"><b>$str</b></font>
+</td></tr>
+</table>
+EOF
+}
+
+sub h2
+{
+ my($str) = @_;
+ return \<<EOF;
+<table cellpadding="2" cellspacing="0" border="0" width="100%">
+<tr>
+<td bgcolor="$Conf{CgiHeaderBgColor}"> <font face="$Conf{CgiHeaderFontType}"
+ size="$Conf{CgiHeaderFontSize}"><b>$str</b></font>
+</td></tr>
+</table>
+EOF
+}
#
#========================================================================
#
-# Version 1.5.0, released 2 Aug 2002.
+# Version __VERSION__, released __RELEASEDATE__.
#
# See http://backuppc.sourceforge.net.
#
printf("Installing library in $Conf{InstallDir}/lib\n");
foreach my $lib ( qw(BackupPC/Lib.pm BackupPC/FileZIO.pm BackupPC/Attrib.pm
BackupPC/PoolWrite.pm BackupPC/Xfer/Tar.pm BackupPC/Xfer/Smb.pm
- BackupPC/Zip/FileMember.pm) ) {
+ BackupPC/Zip/FileMember.pm
+ BackupPC/Lang/en.pm BackupPC/Lang/fr.pm
+ ) ) {
InstallFile("lib/$lib", "$Conf{InstallDir}/lib/$lib", 0444);
}
=head1 BackupPC Introduction
-This documentation describes BackupPC version 1.5.0,
-released on 2 Aug 2002.
+This documentation describes BackupPC version __VERSION__,
+released on __RELEASEDATE__.
=head2 Overview
make install
Now let's move onto BackupPC itself. After fetching
-BackupPC-1.5.0.tar.gz, run these commands as root:
+BackupPC-__VERSION__.tar.gz, run these commands as root:
- tar zxf BackupPC-1.5.0.tar.gz
- cd BackupPC-1.5.0
+ tar zxf BackupPC-__VERSION__.tar.gz
+ cd BackupPC-__VERSION__
perl configure.pl
You will be prompted for the full paths of various executables, and
<IfModule mod_perl.c>
PerlModule Apache::Registry
+ PerlTaintCheck On
<Location /cgi-bin/BackupPC/BackupPC_Admin> # <--- change path as needed
SetHandler perl-script
PerlHandler Apache::Registry
All configuration settings in the second through fifth groups can
be overridden by the per-PC config.pl file.
-=head2 General server configuration
-
-=over 4
-
-=item $Conf{ServerHost} = '';
-
-Host name on which the BackupPC server is running.
-
-=item $Conf{ServerPort} = -1;
-
-TCP port number on which the BackupPC server listens for and accepts
-connections. Normally this should be disabled (set to -1). The TCP
-port is only needed if apache runs on a different machine from BackupPC.
-In that case, set this to any spare port number over 1024 (eg: 2359).
-If you enable the TCP port, make sure you set $Conf{ServerMesgSecret}
-too!
-
-=item $Conf{ServerMesgSecret} = '';
-
-Shared secret to make the TCP port secure. Set this to a hard to guess
-string if you enable the TCP port (ie: $Conf{ServerPort} > 0).
-
-To avoid possible attacks via the TCP socket interface, every client
-message is protected by an MD5 digest. The MD5 digest includes four
-items:
- - a seed that is sent to the client when the connection opens
- - a sequence number that increments for each message
- - a shared secret that is stored in $Conf{ServerMesgSecret}
- - the message itself.
-
-The message is sent in plain text preceded by the MD5 digest. A
-snooper can see the plain-text seed sent by BackupPC and plain-text
-message from the client, but cannot construct a valid MD5 digest since
-the secret $Conf{ServerMesgSecret} is unknown. A replay attack is
-not possible since the seed changes on a per-connection and
-per-message basis.
-
-=item $Conf{MyPath} = '/bin';
-
-PATH setting for BackupPC. An explicit value is necessary
-for taint mode. Value shouldn't matter too much since
-all execs use explicit paths. However, taint mode in perl
-will complain if this directory is world writable.
-
-=item $Conf{UmaskMode} = 027;
-
-Permission mask for directories and files created by BackupPC.
-Default value prevents any access from group other, and prevents
-group write.
-
-=item $Conf{WakeupSchedule} = [1..23];
-
-Times at which we wake up, check all the PCs, and schedule necessary
-backups. Times are measured in hours since midnight. Can be
-fractional if necessary (eg: 4.25 means 4:15am).
-
-If the hosts you are backing up are always connected to the network
-you might have only one or two wakeups each night. This will keep
-the backup activity after hours. On the other hand, if you are backing
-up laptops that are only intermittently connected to the network you
-will want to have frequent wakeups (eg: hourly) to maximized the chance
-that each laptop is backed up.
-
-Examples:
-
- $Conf{WakeupSchedule} = [22.5]; # once per day at 10:30 pm.
- $Conf{WakeupSchedule} = [1..23]; # every hour except midnight
- $Conf{WakeupSchedule} = [2,4,6,8,10,12,14,16,18,20,22]; # every 2 hours
-
-The default value is every hour except midnight.
-
-=item $Conf{MaxBackups} = 4;
-
-Maximum number of simultaneous backups to run. If there
-are no user backup requests then this is the maximum number
-of simultaneous backups.
-
-=item $Conf{MaxUserBackups} = 4;
-
-Additional number of simultaneous backups that users can run.
-As many as $Conf{MaxBackups} + $Conf{MaxUserBackups} requests can
-run at the same time.
-
-=item $Conf{MaxPendingCmds} = 10;
-
-Maximum number of pending link commands. New backups will only be
-started if there are no more than $Conf{MaxPendingCmds} plus
-$Conf{MaxBackups} number of pending link commands, plus running jobs.
-This limit is to make sure BackupPC doesn't fall too far behind in
-running BackupPC_link commands.
-
-=item $Conf{MaxOldLogFiles} = 14;
-
-Maximum number of log files we keep around in log directory.
-These files are aged nightly. A setting of 14 means the log
-directory will contain about 2 weeks of old log files, in
-particular at most the files LOG, LOG.0, LOG.1, ... LOG.13
-(except today's LOG, these files will have a .z extension if
-compression is on).
-
-If you decrease this number after BackupPC has been running for a
-while you will have to manually remove the older log files.
-
-=item $Conf{DfPath} = '/bin/df';
-
-Full path to the df command. Security caution: normal users
-should not allowed to write to this file or directory.
-
-=item $Conf{DfMaxUsagePct} = 95;
-
-Maximum threshold for disk utilization on the __TOPDIR__ filesystem.
-If the output from $Conf{DfPath} reports a percentage larger than
-this number then no new regularly scheduled backups will be run.
-However, user requested backups (which are usually incremental and
-tend to be small) are still performed, independent of disk usage.
-Also, currently running backups will not be terminated when the disk
-usage exceeds this number.
-
-=item $Conf{TrashCleanSleepSec} = 300;
-
-How long BackupPC_trashClean sleeps in seconds between each check
-of the trash directory. Once every 5 minutes should be reasonable.
-
-=item $Conf{DHCPAddressRanges} = [];
-
-List of DHCP address ranges we search looking for PCs to backup.
-This is an array of hashes for each class C address range.
-
-Examples:
-
- # to specify 192.10.10.20 to 192.10.10.250 as the DHCP address pool
- $Conf{DHCPAddressRanges} = [
- {
- ipAddrBase => '192.10.10',
- first => 20,
- last => 250,
- },
- ];
- # to specify two pools (192.10.10.20-250 and 192.10.11.10-50)
- $Conf{DHCPAddressRanges} = [
- {
- ipAddrBase => '192.10.10',
- first => 20,
- last => 250,
- },
- {
- ipAddrBase => '192.10.11',
- first => 10,
- last => 50,
- },
- ];
-
-=item $Conf{BackupPCUser} = '';
-
-=item $Conf{CgiDir} = '';
-
-=item $Conf{InstallDir} = '';
-
-These configuration settings aren't used by BackupPC, but simply
-remember a few settings used by configure.pl during installation.
-These are used by configure.pl when upgrading to new versions of
-BackupPC.
-
-=item $Conf{BackupPCUserVerify} = 1;
-
-Whether BackupPC and the CGI script BackupPC_Admin verify that they
-are really running as user $Conf{BackupPCUser}. If this flag is set
-and the effective user id (euid) differs from $Conf{BackupPCUser}
-then both scripts exit with an error. This catches cases where
-BackupPC might be accidently started as root or the wrong user,
-or if the CGI script is not installed correctly.
-
-=back
-
-=head2 What to backup and when to do it
-
-=over 4
-
-=item $Conf{SmbShareName} = 'C$';
-
-Name of the host share that is backed up when using SMB. This can be a
-string or an array of strings if there are multiple shares per host.
-Examples:
-
-
- $Conf{SmbShareName} = 'c'; # backup 'c' share
- $Conf{SmbShareName} = ['c', 'd']; # backup 'c' and 'd' shares
-
-This setting only matters if $Conf{XferMethod} = 'smb'.
-
-=item $Conf{SmbShareUserName} = '';
-
-Smbclient share user name. This is passed to smbclient's -U argument.
-
-This setting only matters if $Conf{XferMethod} = 'smb'.
-
-=item $Conf{SmbSharePasswd} = '';
-
-Smbclient share password. This is passed to smbclient via the PASSWD
-environment variable. There are several ways you can tell BackupPC
-the smb share password. In each case you should be very careful about
-security. If you put the password here, make sure that this file is
-not readable by regular users! See the "Setting up config.pl" section
-in the documentation for more information.
-
-This setting only matters if $Conf{XferMethod} = 'smb'.
-
-=item $Conf{TarShareName} = '/';
-
-Which host directories to backup when using tar transport. This can be a
-string or an array of strings if there are multiple directories to
-backup per host. Examples:
-
-
- $Conf{TarShareName} = '/'; # backup everything
- $Conf{TarShareName} = '/home'; # only backup /home
- $Conf{TarShareName} = ['/home', '/src']; # backup /home and /src
-
-The fact this parameter is called 'TarShareName' is for historical
-consistency with the Smb transport options. You can use any valid
-directory on the client: there is no need for it to correspond to
-any Smb share or device mount point.
-
-Note also that you can also use $Conf{BackupFilesOnly} to specify
-a specific list of directories to backup. It's more efficient to
-use this option instead of $Conf{TarShareName} since a new tar is
-run for each entry in $Conf{TarShareName}.
-
-This setting only matters if $Conf{XferMethod} = 'tar'.
-
-=item $Conf{FullPeriod} = 6.97;
-
-Minimum period in days between full backups. A full dump will only be
-done if at least this much time has elapsed since the last full dump,
-and at least $Conf{IncrPeriod} days has elapsed since the last
-successful dump.
-
-Typically this is set slightly less than an integer number of days. The
-time taken for the backup, plus the granularity of $Conf{WakeupSchedule}
-will make the actual backup interval a bit longer.
-
-=item $Conf{IncrPeriod} = 0.97;
-
-Minimum period in days between incremental backups (a user requested
-incremental backup will be done anytime on demand).
-
-Typically this is set slightly less than an integer number of days. The
-time taken for the backup, plus the granularity of $Conf{WakeupSchedule}
-will make the actual backup interval a bit longer.
-
-=item $Conf{FullKeepCnt} = 1;
-
-Number of full backups to keep. Must be >= 1.
-
-In the steady state, each time a full backup completes successfully
-the oldest one is removed. If this number is decreased, the
-extra old backups will be removed.
-
-If filling of incremental dumps is off the oldest backup always
-has to be a full (ie: filled) dump. This might mean an extra full
-dump is kept until the second oldest (incremental) dump expires.
-
-=item $Conf{FullKeepCntMin} = 1;
-
-=item $Conf{FullAgeMax} = 60;
-
-Very old full backups are removed after $Conf{FullAgeMax} days. However,
-we keep at least $Conf{FullKeepCntMin} full backups no matter how old
-they are.
-
-=item $Conf{IncrKeepCnt} = 6;
-
-Number of incremental backups to keep. Must be >= 1.
-
-In the steady state, each time an incr backup completes successfully
-the oldest one is removed. If this number is decreased, the
-extra old backups will be removed.
-
-=item $Conf{IncrKeepCntMin} = 1;
-
-=item $Conf{IncrAgeMax} = 30;
-
-Very old incremental backups are removed after $Conf{IncrAgeMax} days.
-However, we keep at least $Conf{IncrKeepCntMin} incremental backups no
-matter how old they are.
-
-=item $Conf{IncrFill} = 0;
-
-Whether incremental backups are filled. "Filling" means that the
-most recent full (or filled) dump is merged into the new incremental
-dump using hardlinks. This makes an incremental dump look like a
-full dump. Prior to v1.03 all incremental backups were filled.
-In v1.4.0 and later the default is off.
-
-BackupPC, and the cgi interface in particular, do the right thing on
-un-filled incremental backups. It will correctly display the merged
-incremental backup with the most recent filled backup, giving the
-un-filled incremental backups a filled appearance. That means it
-invisible to the user whether incremental dumps are filled or not.
-
-Filling backups takes a little extra disk space, and it does cost
-some extra disk activity for filling, and later removal. Filling
-is no longer useful, since file mangling and compression doesn't
-make a filled backup very useful. It's likely the filling option
-will be removed from future versions: filling will be delegated to
-the display and extraction of backup data.
-
-If filling is off, BackupPC makes sure that the oldest backup is
-a full, otherwise the following incremental backups will be
-incomplete. This might mean an extra full backup has to be
-kept until the following incremental backups expire.
-
-The default is off. You can turn this on or off at any
-time without affecting existing backups.
-
-=item $Conf{RestoreInfoKeepCnt} = 10;
-
-Number of restore logs to keep. BackupPC remembers information about
-each restore request. This number per client will be kept around before
-the oldest ones are pruned.
-
-Note: files/dirs delivered via Zip or Tar downloads don't count as
-restores. Only the first restore option (where the files and dirs
-are written to the host) count as restores that are logged.
-
-=item $Conf{BackupFilesOnly} = undef;
-
-List of directories or files to backup. If this is defined, only these
-directories or files will be backed up.
-
-For Smb, only one of $Conf{BackupFilesExclude} and $Conf{BackupFilesOnly}
-can be specified per share. If both are set for a particular share, then
-$Conf{BackupFilesOnly} takes precedence and $Conf{BackupFilesExclude}
-is ignored.
-
-This can be set to a string, an array of strings, or, in the case
-of multiple shares, a hash of strings or arrays. A hash is used
-to give a list of directories or files to backup for each share
-(the share name is the key). If this is set to just a string or
-array, and $Conf{SmbShareName} contains multiple share names, then
-the setting is assumed to apply to only the first share name.
-
-Examples:
-
- $Conf{BackupFilesOnly} = '/myFiles';
- $Conf{BackupFilesOnly} = ['/myFiles']; # same as first example
- $Conf{BackupFilesOnly} = ['/myFiles', '/important'];
- $Conf{BackupFilesOnly} = {
- 'c' => ['/myFiles', '/important'], # these are for 'c' share
- 'd' => ['/moreFiles', '/archive'], # these are for 'd' share
- }
-
-=item $Conf{BackupFilesExclude} = undef;
-
-List of directories or files to exclude from the backup. For Smb,
-only one of $Conf{BackupFilesExclude} and $Conf{BackupFilesOnly}
-can be specified per share. If both are set for a particular share,
-then $Conf{BackupFilesOnly} takes precedence and
-$Conf{BackupFilesExclude} is ignored.
-
-This can be set to a string, an array of strings, or, in the case
-of multiple shares, a hash of strings or arrays. A hash is used
-to give a list of directories or files to exclude for each share
-(the share name is the key). If this is set to just a string or
-array, and $Conf{SmbShareName} contains multiple share names, then
-the setting is assumed to apply to only the first share name.
-
-The exact behavior is determined by the underlying transport program,
-smbclient or tar. For smbclient the exlclude file list is passed into
-the X option. Simple shell wild-cards using "*" or "?" are allowed.
-
-For tar, if the exclude file contains a "/" it is assumed to be anchored
-at the start of the string. Since all the tar paths start with "./",
-BackupPC prepends a "." if the exclude file starts with a "/". Note
-that GNU tar version >= 1.3.7 is required for the exclude option to
-work correctly. For linux or unix machines it is recommended to add
-"/proc" to $Conf{BackupFilesExclude}.
-
-Examples:
-
- $Conf{BackupFilesExclude} = '/temp';
- $Conf{BackupFilesExclude} = ['/temp']; # same as first example
- $Conf{BackupFilesExclude} = ['/temp', '/winnt/tmp'];
- $Conf{BackupFilesExclude} = {
- 'c' => ['/temp', '/winnt/tmp'], # these are for 'c' share
- 'd' => ['/junk', '/dont_back_this_up'], # these are for 'd' share
- }
-
-=item $Conf{BlackoutBadPingLimit} = 3;
-
-=item $Conf{BlackoutGoodCnt} = 7;
-
-PCs that are always or often on the network can be backed up after
-hours, to reduce PC, network and server load during working hours. For
-each PC a count of consecutive good pings is maintained. Once a PC has
-at least $Conf{BlackoutGoodCnt} consecutive good pings it is subject
-to "blackout" and not backed up during hours and days specified by
-$Conf{BlackoutWeekDays}, $Conf{BlackoutHourBegin} and
-$Conf{BlackoutHourEnd}.
-
-To allow for periodic rebooting of a PC or other brief periods when a
-PC is not on the network, a number of consecutive bad pings is allowed
-before the good ping count is reset. This parameter is
-$Conf{BlackoutBadPingLimit}.
-
-Note that bad and good pings don't occur with the same interval. If a
-machine is always on the network, it will only be pinged roughly once
-every $Conf{IncrPeriod} (eg: once per day). So a setting for
-$Conf{BlackoutGoodCnt} of 7 means it will take around 7 days for a
-machine to be subject to blackout. On the other hand, if a ping is
-failed, it will be retried roughly every time BackupPC wakes up, eg,
-every one or two hours. So a setting for $Conf{BlackoutBadPingLimit} of
-3 means that the PC will lose its blackout status after 3-6 hours of
-unavailability.
-
-To disable the blackout feature set $Conf{BlackoutGoodCnt} to a negative
-value. A value of 0 will make all machines subject to blackout. But
-if you don't want to do any backups during the day it would be easier
-to just set $Conf{WakeupSchedule} to a restricted schedule.
-
-=item $Conf{BlackoutHourBegin} = 7.0;
-
-=item $Conf{BlackoutHourEnd} = 19.5;
-
-=item $Conf{BlackoutWeekDays} = [1, 2, 3, 4, 5];
-
-The default settings specify the blackout period from 7:00am to
-7:30pm local time on Mon-Fri. For $Conf{BlackoutWeekDays},
-0 is Sunday, 1 is Monday etc.
-
-=back
-
-=head2 General per-PC configuration settings
-
-=over 4
-
-=item $Conf{XferMethod} = 'smb';
-
-What transport method to use to backup each host. If you have
-a mixed set of WinXX and linux/unix hosts you will need to override
-this in the per-PC config.pl.
-
-The valid values are:
-
- - 'smb': use smbclient and the SMB protocol. Only choice for WinXX.
-
- - 'tar': use tar, tar over ssh, rsh or nfs. Best choice for
- linux/unix.
-
-A future version should support 'rsync' as a transport method for
-more efficient backup of linux/unix machines (and perhaps WinXX??).
-
-=item $Conf{SmbClientPath} = '/usr/bin/smbclient';
-
-Full path for smbclient. Security caution: normal users should not
-allowed to write to this file or directory.
-
-smbclient is from the Samba distribution. smbclient is used to
-actually extract the incremental or full dump of the share filesystem
-from the PC.
-
-This setting only matters if $Conf{XferMethod} = 'smb'.
-
-=item $Conf{SmbClientArgs} = '';
-
-Additional optional arguments to smbclient.
-
-Some users have reported that the -b option can be used to improve
-performance of smbclient. The default value is 4096, and if you
-find smbclient has low throughput you might try a value of 2048, eg:
-
- $Conf{SmbClientArgs} = '-b 2048';
-
-This setting only matters if $Conf{XferMethod} = 'smb'.
-
-=item $Conf{TarClientCmd} = '$sshPath -q -n -l root $host' ...
-
-Full command to run tar on the client. GNU tar is required. You will
-need to fill in the correct paths for ssh2 on the local host (server)
-and GNU tar on the client. Security caution: normal users should not
-allowed to write to these executable files or directories.
-
-See the documentation for more information about setting up ssh2 keys.
-
-If you plan to use NFS then tar just runs locally and ssh2 is not needed.
-For example, assuming the client filesystem is mounted below /mnt/hostName,
-you could use something like:
-
- $Conf{TarClientCmd} = '$tarPath -c -v -f - -C /mnt/$host/$shareName'
- . ' --totals';
-
-In the case of NFS or rsh you need to make sure BackupPC's privileges
-are sufficient to read all the files you want to backup. Also, you
-will probably want to add "/proc" to $Conf{BackupFilesExclude}.
-
-Several variables are substituted at run-time. The following variables
-are substituted at run-time:
-
- $host host name
- $hostIP host's IP address
- $incrDate newer-than date for incremental backups
- $shareName share name to backup (ie: top-level directory path)
- $fileList specific files to backup or exclude
- $tarPath same as $Conf{TarClientPath}
- $sshPath same as $Conf{SshPath}
-
-If a variable is followed by a "+" it is shell escaped. This is
-necessary for the command part of ssh or rsh, since it ends up
-getting passed through the shell.
-
-This setting only matters if $Conf{XferMethod} = 'tar'.
-
-=item $Conf{TarFullArgs} = '$fileList+';
-
-Extra tar arguments for full backups. Several variables are substituted at
-run-time. See $Conf{TarClientCmd} for the list of variable substitutions.
-
-This setting only matters if $Conf{XferMethod} = 'tar'.
-
-=item $Conf{TarIncrArgs} = '--newer=$incrDate+ $fileList+';
-
-Extra tar arguments for incr backups. Several variables are substituted at
-run-time. See $Conf{TarClientCmd} for the list of variable substitutions.
-
-Note that GNU tar has several methods for specifying incremental backups,
-including:
-
- --newer-mtime $incrDate+
- This causes a file to be included if the modification time is
- later than $incrDate (meaning its contents might have changed).
- But changes in the ownership or modes will not qualify the
- file to be included in an incremental.
-
- --newer=$incrDate+
- This causes the file to be included if any attribute of the
- file is later than $incrDate, meaning either attributes or
- the modification time. This is the default method. Do
- not use --atime-preserve in $Conf{TarClientCmd} above,
- otherwise resetting the atime (access time) counts as an
- attribute change, meaning the file will always be included
- in each new incremental dump.
-
-This setting only matters if $Conf{XferMethod} = 'tar'.
-
-=item $Conf{TarClientRestoreCmd} = '$sshPath -q -l root $host' ...
-
-Full command to run tar for restore on the client. GNU tar is required.
-This can be the same as $Conf{TarClientCmd}, with tar's -c replaced by -x
-and ssh's -n removed.
-
-See $Conf{TarClientCmd} for full details.
-
-This setting only matters if $Conf{XferMethod} = "tar".
-
-=item $Conf{TarClientPath} = '/bin/tar';
-
-Full path for tar on the client. Security caution: normal users should not
-allowed to write to this file or directory.
-
-This setting only matters if $Conf{XferMethod} = 'tar'.
-
-=item $Conf{SshPath} = '/usr/bin/ssh';
-
-Full path for ssh. Security caution: normal users should not
-allowed to write to this file or directory.
-
-=item $Conf{NmbLookupPath} = '/usr/bin/nmblookup';
-
-Full path for nmblookup. Security caution: normal users should not
-allowed to write to this file or directory.
-
-nmblookup is from the Samba distribution. nmblookup is used to get the
-netbios name, necessary for DHCP hosts.
-
-=item $Conf{FixedIPNetBiosNameCheck} = 0;
-
-For fixed IP address hosts, BackupPC_dump can also verify the netbios
-name to ensure it matches the host name. An error is generated if
-they do not match. Typically this flag is off. But if you are going
-to transition a bunch of machines from fixed host addresses to DHCP,
-setting this flag is a great way to verify that the machines have
-their netbios name set correctly before turning on DCHP.
-
-=item $Conf{PingPath} = '/bin/ping';
-
-Full path to the ping command. Security caution: normal users
-should not be allowed to write to this file or directory.
-
-If you want to disable ping checking, set this to some program
-that exits with 0 status, eg:
-
- $Conf{PingPath} = '/bin/echo';
-
-=item $Conf{PingArgs} = '-c 1 $host';
-
-Options for the ping command.
-
-=item $Conf{CompressLevel} = 0;
-
-Compression level to use on files. 0 means no compression. Compression
-levels can be from 1 (least cpu time, slightly worse compression) to
-9 (most cpu time, slightly better compression). The recommended value
-is 3. Changing to 5, for example, will take maybe 20% more cpu time
-and will get another 2-3% additional compression. See the zlib
-documentation for more information about compression levels.
-
-Changing compression on or off after backups have already been done
-will require both compressed and uncompressed pool files to be stored.
-This will increase the pool storage requirements, at least until all
-the old backups expire and are deleted.
-
-It is ok to change the compression value (from one non-zero value to
-another non-zero value) after dumps are already done. Since BackupPC
-matches pool files by comparing the uncompressed versions, it will still
-correctly match new incoming files against existing pool files. The
-new compression level will take effect only for new files that are
-newly compressed and added to the pool.
-
-If compression was off and you are enabling compression for the first
-time you can use the BackupPC_compressPool utility to compress the
-pool. This avoids having the pool grow to accommodate both compressed
-and uncompressed backups. See the documentation for more information.
-
-Note: compression needs the Compress::Zlib perl library. If the
-Compress::Zlib library can't be found then $Conf{CompressLevel} is
-forced to 0 (compression off).
-
-=item $Conf{PingMaxMsec} = 20;
-
-Maximum round-trip ping time in milliseconds. This threshold is set
-to avoid backing up PCs that are remotely connected through WAN or
-dialup connections. The output from ping -s (assuming it is supported
-on your system) is used to check the round-trip packet time. On your
-local LAN round-trip times should be much less than 20msec. On most
-WAN or dialup connections the round-trip time will be typically more
-than 20msec. Tune if necessary.
-
-=item $Conf{SmbClientTimeout} = 7200;
-
-Timeout in seconds when listening for the transport program's
-(smbclient, tar etc) stdout. If no output is received during this
-time, then it is assumed that something has wedged during a backup,
-and the backup is terminated.
-
-Note that stdout buffering combined with huge files being backed up
-could cause longish delays in the output from smbclient that
-BackupPC_dump sees, so in rare cases you might want to increase
-this value.
-
-Despite the name, this parameter sets the timeout for all transport
-methods (tar, smb etc).
-
-=item $Conf{MaxOldPerPCLogFiles} = 12;
-
-Maximum number of log files we keep around in each PC's directory
-(ie: pc/$host). These files are aged monthly. A setting of 12
-means there will be at most the files LOG, LOG.0, LOG.1, ... LOG.11
-in the pc/$host directory (ie: about a years worth). (Except this
-month's LOG, these files will have a .z extension if compression
-is on).
-
-If you decrease this number after BackupPC has been running for a
-while you will have to manually remove the older log files.
-
-=back
-
-=head2 Email reminders, status and messages
-
-=over 4
-
-=item $Conf{SendmailPath} = '/usr/sbin/sendmail';
-
-Full path to the sendmail command. Security caution: normal users
-should not allowed to write to this file or directory.
-
-=item $Conf{EMailNotifyMinDays} = 2.5;
-
-Minimum period between consecutive emails to a single user.
-This tries to keep annoying email to users to a reasonable
-level. Email checks are done nightly, so this number is effectively
-rounded up (ie: 2.5 means a user will never receive email more
-than once every 3 days).
-
-=item $Conf{EMailFromUserName} = '';
-
-Name to use as the "from" name for email. Depending upon your mail
-handler this is either a plain name (eg: "admin") or a fully-qualified
-name (eg: "admin@mydomain.com").
-
-=item $Conf{EMailAdminUserName} = '';
-
-Destination address to an administrative user who will receive a
-nightly email with warnings and errors. If there are no warnings
-or errors then no email will be sent. Depending upon your mail
-handler this is either a plain name (eg: "admin") or a fully-qualified
-name (eg: "admin@mydomain.com").
-
-=item $Conf{EMailNoBackupEverMesg} = ...;
-
-This message is sent to a user if their PC has never been backed up.
-If your mailer needs a fully-qualified To name, then change "$user"
-to "$user@mydomain.com" in the template, eg:
-
- To: $user@mydomain.com
-
-=item $Conf{EMailNotifyOldBackupDays} = 7.0;
-
-How old the most recent backup has to be before notifying user.
-When there have been no backups in this number of days the user
-is sent an email.
-
-=item $Conf{EMailNoBackupRecentMesg} = ...;
-
-This message is sent to a user if their PC has not recently been
-backed up (ie: more than $Conf{EMailNotifyOldBackupDays} days ago).
-
-If your mailer needs a fully-qualified To name, then change "$user"
-to "$user@mydomain.com" in the template, eg:
-
- To: $user@mydomain.com
-
-=item $Conf{EMailNotifyOldOutlookDays} = 5.0;
-
-How old the most recent backup of Outlook files has to be before
-notifying user.
-
-=item $Conf{EMailOutlookBackupMesg} = ...;
-
-This message is sent to a user if their Outlook files have not
-recently been backed up (ie: more than $Conf{EMailNotifyOldOutlookDays}
-days ago).
-
-If your mailer needs a fully-qualified To name, then change "$user"
-to "$user@mydomain.com" in the template, eg:
-
- To: $user@mydomain.com
-
-=back
-
-=head2 CGI user interface configuration settings
-
-=over 4
-
-=item $Conf{CgiAdminUserGroup} = '';
-
-=item $Conf{CgiAdminUsers} = '';
-
-Normal users can only access information specific to their host.
-They can start/stop/browse/restore backups.
-
-Administrative users have full access to all hosts, plus overall
-status and log information.
-
-The administrative users are the union of the unix/linux group
-$Conf{CgiAdminUserGroup} and the manual list of users, separated
-by spaces, in $Conf{CgiAdminUsers}. If you don't want a group or
-manual list of users set the corresponding configuration setting
-to undef or an empty string.
-
-If you want every user to have admin privileges (careful!), set
-$Conf{CgiAdminUsers} = '*'.
-
-Examples:
-
- $Conf{CgiAdminUserGroup} = 'admin';
- $Conf{CgiAdminUsers} = 'craig celia';
- --> administrative users are the union of group admin, plus
- craig and celia.
-
- $Conf{CgiAdminUserGroup} = '';
- $Conf{CgiAdminUsers} = 'craig celia';
- --> administrative users are only craig and celia'.
-
-=item $Conf{CgiUserHomePageCheck} = '';
-
-=item $Conf{CgiUserUrlCreate} = 'mailto:%s';
-
-User names that are rendered by the CGI interface can be turned
-into links into their home page or other information about the
-user. To set this up you need to create two sprintf() strings,
-that each contain a single '%s' that will be replaced by the user
-name. The default is a mailto: link.
-
-$Conf{CgiUserHomePageCheck} should be an absolute file path that
-is used to check (via "-f") that the user has a valid home page.
-Set this to undef or an empty string to turn off this check.
-
-$Conf{CgiUserUrlCreate} should be a full URL that points to the
-user's home page. Set this to undef or an empty string to turn
-off generation of URLs for user names.
-
-Example:
-
- $Conf{CgiUserHomePageCheck} = '/var/www/html/users/%s.html';
- $Conf{CgiUserUrlCreate} = 'http://myhost/users/%s.html';
- --> if /var/www/html/users/craig.html exists, then 'craig' will
- be rendered as a link to http://myhost/users/craig.html.
-
-=item $Conf{CgiDateFormatMMDD} = 1;
-
-Date display format for CGI interface. True for US-style dates (MM/DD)
-and zero for international dates (DD/MM).
-
-=item $Conf{CgiHeaderFontType} = 'arial';
-
-=item $Conf{CgiHeaderFontSize} = '3';
-
-Header font and size for CGI interface
-
-=item $Conf{CgiNavBarBgColor} = '#ddeeee';
-
-=item $Conf{CgiHeaderBgColor} = '#99cc33';
-
-Color scheme for CGI interface. Default values give a very light blue
-for the background navigation color and green for the header background.
-(You call tell I'm a better programmer than graphical designer.)
-
-=item $Conf{CgiHeaders} = '<meta http-equiv="pragma" content="no-cache">';
-
-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">
-
-=item $Conf{CgiImageDir} = '';
-
-Directory where images are stored. This directory should be below
-Apache's DocumentRoot. This value isn't used by BackupPC but is
-used by configure.pl when you upgrade BackupPC.
-
-Example:
-
- $Conf{CgiImageDir} = '/usr/local/apache/htdocs/BackupPC';
-
-=item $Conf{CgiImageDirURL} = '';
-
-URL (without the leading http://host) for BackupPC's image directory.
-The CGI script uses this value to serve up image files.
-
-Example:
-
- $Conf{CgiImageDirURL} = '/BackupPC';
-
-=back
-
+__CONFIGPOD__
=head1 Version Numbers
--- /dev/null
+#!/usr/bin/perl -w
+
+#my %lang;
+
+#use strict;
+
+# --------------------------------
+
+$Lang{Start_Full_Backup} = "Start Full Backup";
+$Lang{Start_Incr_Backup} = "Start Incr Backup";
+$Lang{Stop_Dequeue_Backup} = "Stop/Dequeue Backup";
+$Lang{Restore} = "Restore";
+
+# -----
+
+$Lang{H_BackupPC_Server_Status} = "BackupPC Server Status";
+
+$Lang{BackupPC_Server_Status}= <<EOF;
+\${h1(qq{$Lang{H_BackupPC_Server_Status}})}
+
+<p>
+\${h2(\"General Server Information\")}
+
+<ul>
+<li> The servers PID is \$Info{pid}, on host \$Conf{ServerHost},
+ version \$Info{Version}, started at \$serverStartTime.
+<li> This status was generated at \$now.
+<li> PCs will be next queued at \$nextWakeupTime.
+<li> Other info:
+ <ul>
+ <li>\$numBgQueue pending backup requests from last scheduled wakeup,
+ <li>\$numUserQueue pending user backup requests,
+ <li>\$numCmdQueue pending command requests,
+ \$poolInfo
+ <li>Pool file system was recently at \$Info{DUlastValue}%
+ (\$DUlastTime), today\'s max is \$Info{DUDailyMax}% (\$DUmaxTime)
+ and yesterday\'s max was \$Info{DUDailyMaxPrev}%.
+ </ul>
+</ul>
+
+\${h2("Currently Running Jobs")}
+<p>
+<table border>
+<tr><td> Host </td>
+ <td> Type </td>
+ <td> User </td>
+ <td> Start Time </td>
+ <td> Command </td>
+ <td align="center"> PID </td>
+ <td> Xfer PID </td>
+ \$tarPidHdr</tr>
+\$jobStr
+</table>
+<p>
+
+\${h2("Failures that need attention")}
+<p>
+<table border>
+<tr><td align="center"> Host </td>
+ <td align="center"> Type </td>
+ <td align="center"> User </td>
+ <td align="center"> Last Try </td>
+ <td align="center"> Details </td>
+ <td align="center"> Error Time </td>
+ <td> Last error (other than no ping) </td></tr>
+\$statusStr
+</table>
+EOF
+
+# --------------------------------
+$Lang{BackupPC__Server_Summary} = "BackupPC: Server Summary";
+$Lang{BackupPC_Summary}=<<EOF;
+
+\${h1(qq{$Lang{BackupPC__Server_Summary}})}
+<p>
+This status was generated at \$now.
+<p>
+
+\${h2("Hosts with good Backups")}
+<p>
+There are \$hostCntGood hosts that have been backed up, for a total of:
+<ul>
+<li> \$fullTot full backups of total size \${fullSizeTot}GB
+ (prior to pooling and compression),
+<li> \$incrTot incr backups of total size \${incrSizeTot}GB
+ (prior to pooling and compression).
+</ul>
+<table border>
+<tr><td> Host </td>
+ <td align="center"> User </td>
+ <td align="center"> #Full </td>
+ <td align="center"> Full Age/days </td>
+ <td align="center"> Full Size/GB </td>
+ <td align="center"> Speed MB/sec </td>
+ <td align="center"> #Incr </td>
+ <td align="center"> Incr Age/days </td>
+ <td align="center"> State </td>
+ <td align="center"> Last attempt </td></tr>
+\$strGood
+</table>
+<p>
+
+\${h2("Hosts with no Backups")}
+<p>
+There are \$hostCntNone hosts with no backups.
+<p>
+<table border>
+<tr><td> Host </td>
+ <td align="center"> User </td>
+ <td align="center"> #Full </td>
+ <td align="center"> Full Age/days </td>
+ <td align="center"> Full Size/GB </td>
+ <td align="center"> Speed MB/sec </td>
+ <td align="center"> #Incr </td>
+ <td align="center"> Incr Age/days </td>
+ <td align="center"> Current State </td>
+ <td align="center"> Last backup attempt </td></tr>
+\$strNone
+</table>
+EOF
+
+# -----------------------------------
+$Lang{Pool_Stat} = <<EOF;
+ <li>Pool is \${poolSize}GB comprising \$info->{"\${name}FileCnt"} files
+ and \$info->{"\${name}DirCnt"} directories (as of \$poolTime),
+ <li>Pool hashing gives \$info->{"\${name}FileCntRep"} repeated
+ files with longest chain \$info->{"\${name}FileRepMax"},
+ <li>Nightly cleanup removed \$info->{"\${name}FileCntRm"} files of
+ size \${poolRmSize}GB (around \$poolTime),
+EOF
+
+# --------------------------------
+$Lang{BackupPC__Backup_Requested_on__host} = "BackupPC: Backup Requested on \$host";
+# --------------------------------
+$Lang{REPLY_FROM_SERVER} = <<EOF;
+\${h1(\$str)}
+<p>
+Reply from server was: \$reply
+<p>
+Go back to <a href="\$MyURL?host=\$host">\$host home page</a>.
+EOF
+# --------------------------------
+$Lang{BackupPC__Start_Backup_Confirm_on__host} = "BackupPC: Start Backup Confirm on \$host";
+# --------------------------------
+$Lang{Are_you_sure_start} = <<EOF;
+\${h1("Are you sure?")}
+<p>
+You are about to start a \$type backup on \$host.
+
+<form action="\$MyURL" method="get">
+<input type="hidden" name="host" value="\$host">
+<input type="hidden" name="hostIP" value="\$ipAddr">
+<input type="hidden" name="doit" value="1">
+Do you really want to do this?
+<input type="submit" value="\$In{action}" name="action">
+<input type="submit" value="No" name="">
+</form>
+EOF
+# --------------------------------
+$Lang{BackupPC__Stop_Backup_Confirm_on__host} = "BackupPC: Stop Backup Confirm on \$host";
+# --------------------------------
+$Lang{Are_you_sure_stop} = <<EOF;
+
+\${h1("Are you sure?")}
+
+<p>
+You are about to stop/dequeue backups on \$host;
+
+<form action="\$MyURL" method="get">
+<input type="hidden" name="host" value="\$host">
+<input type="hidden" name="doit" value="1">
+Also, please don\'t start another backup for
+<input type="text" name="backoff" size="10" value="\$backoff"> hours.
+<p>
+Do you really want to do this?
+<input type="submit" value="\$In{action}" name="action">
+<input type="submit" value="No" name="">
+</form>
+
+EOF
+# --------------------------------
+$Lang{Only_privileged_users_can_view_queues_} = "Only privileged users can view queues.";
+# --------------------------------
+$Lang{BackupPC__Queue_Summary} = "BackupPC: Queue Summary";
+# --------------------------------
+$Lang{Backup_Queue_Summary} = <<EOF;
+\${h1("Backup Queue Summary")}
+<p>
+\${h2("User Queue Summary")}
+<p>
+The following user requests are currently queued:
+<table border>
+<tr><td> Host </td>
+ <td> Req Time </td>
+ <td> User </td></tr>
+\$strUser
+</table>
+<p>
+
+\${h2("Background Queue Summary")}
+<p>
+The following background requests are currently queued:
+<table border>
+<tr><td> Host </td>
+ <td> Req Time </td>
+ <td> User </td></tr>
+\$strBg
+</table>
+<p>
+
+\${h2("Command Queue Summary")}
+<p>
+The following command requests are currently queued:
+<table border>
+<tr><td> Host </td>
+ <td> Req Time </td>
+ <td> User </td>
+ <td> Command </td></tr>
+\$strCmd
+</table>
+EOF
+
+# --------------------------------
+$Lang{Backup_PC__Log_File__file} = "BackupPC: Log File \$file";
+$Lang{Log_File__file__comment} = <<EOF;
+"Log File \$file \$comment";
+<p>
+EOF
+# --------------------------------
+$Lang{Contents_of_log_file} = <<EOF;
+Contents of log file <tt>\$file</tt>, modified \$mtimeStr \$comment
+EOF
+
+# --------------------------------
+$Lang{skipped__skipped_lines} = "[ skipped \$skipped lines ]\n";
+# --------------------------------
+$Lang{_pre___Can_t_open_log_file__file} = "<pre>\nCan\'t open log file \$file\n";
+
+# --------------------------------
+$Lang{BackupPC__Log_File_History} = "BackupPC: Log File History";
+$Lang{Log_File_History__hdr} = <<EOF;
+\${h1("Log File History \$hdr")}
+<p>
+<table border>
+<tr><td align="center"> File </td>
+ <td align="center"> Size </td>
+ <td align="center"> Modification time </td></tr>
+\$str
+</table>
+EOF
+
+# -------------------------------
+$Lang{Recent_Email_Summary} = <<EOF;
+\${h1("Recent Email Summary (Reverse time order)")}
+<p>
+<table border>
+<tr><td align="center"> Recipient </td>
+ <td align="center"> Host </td>
+ <td align="center"> Time </td>
+ <td align="center"> Subject </td></tr>
+\$str
+</table>
+EOF
+
+
+# ------------------------------
+$Lang{Browse_backup__num_for__host} = "BackupPC: Browse backup \$num for \$host";
+
+# ------------------------------
+$Lang{Restore_Options_for__host} = "BackupPC: Restore Options for \$host";
+$Lang{Restore_Options_for__host2} = <<EOF;
+<p>
+You have selected the following files/directories from
+share \$share, backup number #\$num:
+<ul>
+\$fileListStr
+</ul>
+<p>
+You have three choices for restoring these files/directories.
+Please select one of the following options.
+<p>
+\${h2("Option 1: Direct Restore")}
+<p>
+You can start a restore that will restore these files directly onto
+\$host.
+<p>
+<b>Warning:</b> any existing files that match the ones you have
+selected will be overwritten!
+
+<form action="\$MyURL" method="post">
+<input type="hidden" name="host" value="\${EscapeHTML(\$host)}">
+<input type="hidden" name="num" value="\$num">
+<input type="hidden" name="type" value="3">
+\$hiddenStr
+<input type="hidden" value="\$In{action}" name="action">
+<table border="0">
+<tr>
+ <td>Restore the files to host</td>
+ <td><input type="text" size="40" value="\${EscapeHTML(\$host)}"
+ name="hostDest"></td>
+</tr><tr>
+ <td>Restore the files to share</td>
+ <td><input type="text" size="40" value="\${EscapeHTML(\$share)}"
+ name="shareDest"></td>
+</tr><tr>
+ <td>Restore the files below dir<br>(relative to share)</td>
+ <td valign="top"><input type="text" size="40" maxlength="256"
+ value="\${EscapeHTML(\$pathHdr)}" name="pathHdr"></td>
+</tr><tr>
+ <td><input type="submit" value="Start Restore" name=""></td>
+</table>
+</form>
+EOF
+
+# ------------------------------
+$Lang{Option_2__Download_Zip_archive} = <<EOF;
+
+\${h2("Option 2: Download Zip archive")}
+<p>
+You can download a Zip archive containing all the files/directories you have
+selected. You can then use a local application, such as WinZip,
+to view or extract any of the files.
+<p>
+<b>Warning:</b> depending upon which files/directories you have selected,
+this archive might be very very large. It might take many minutes to
+create and transfer the archive, and you will need enough local disk
+space to store it.
+<p>
+<form action="\$MyURL" method="post">
+<input type="hidden" name="host" value="\${EscapeHTML(\$host)}">
+<input type="hidden" name="num" value="\$num">
+<input type="hidden" name="type" value="2">
+\$hiddenStr
+<input type="hidden" value="\$In{action}" name="action">
+<input type="checkbox" value="1" name="relative" checked> Make archive relative
+to \${EscapeHTML(\$pathHdr eq "" ? "/" : \$pathHdr)}
+(otherwise archive will contain full paths).
+<br>
+Compression (0=off, 1=fast,...,9=best)
+<input type="text" size="6" value="5" name="compressLevel">
+<br>
+<input type="submit" value="Download Zip File" name="">
+</form>
+EOF
+
+# ------------------------------
+
+$Lang{Option_2__Download_Zip_archive2} = <<EOF;
+\${h2("Option 2: Download Zip archive")}
+<p>
+You could download a zip archive, but Archive::Zip is not installed.
+Please ask your system adminstrator to install Archive::Zip from
+<a href="http://www.cpan.org">www.cpan.org</a>.
+<p>
+EOF
+
+
+# ------------------------------
+$Lang{Option_3__Download_Zip_archive} = <<EOF;
+\${h2("Option 3: Download Tar archive")}
+<p>
+You can download a Tar archive containing all the files/directories you
+have selected. You can then use a local application, such as tar or
+WinZip to view or extract any of the files.
+<p>
+<b>Warning:</b> depending upon which files/directories you have selected,
+this archive might be very very large. It might take many minutes to
+create and transfer the archive, and you will need enough local disk
+space to store it.
+<p>
+<form action="\$MyURL" method="post">
+<input type="hidden" name="host" value="\${EscapeHTML(\$host)}">
+<input type="hidden" name="num" value="\$num">
+<input type="hidden" name="type" value="1">
+\$hiddenStr
+<input type="hidden" value="\$In{action}" name="action">
+<input type="checkbox" value="1" name="relative" checked> Make archive relative
+to \${EscapeHTML(\$pathHdr eq "" ? "/" : \$pathHdr)}
+(otherwise archive will contain full paths).
+<br>
+<input type="submit" value="Download Tar File" name="">
+</form>
+EOF
+
+
+# ------------------------------
+$Lang{Restore_Confirm_on__host} = "BackupPC: Restore Confirm on \$host";
+
+$Lang{Are_you_sure} = <<EOF;
+\${h1("Are you sure?")}
+<p>
+You are about to start a restore directly to the machine \$In{hostDest}.
+The following files will be restored to share \$In{shareDest}, from
+backup number \$num:
+<p>
+<table border>
+<tr><td>Original file/dir</td><td>Will be restored to</td></tr>
+\$fileListStr
+</table>
+
+<form action="\$MyURL" method="post">
+<input type="hidden" name="host" value="\${EscapeHTML(\$host)}">
+<input type="hidden" name="hostDest" value="\${EscapeHTML(\$In{hostDest})}">
+<input type="hidden" name="shareDest" value="\${EscapeHTML(\$In{shareDest})}">
+<input type="hidden" name="pathHdr" value="\${EscapeHTML(\$In{pathHdr})}">
+<input type="hidden" name="num" value="\$num">
+<input type="hidden" name="type" value="4">
+\$hiddenStr
+Do you really want to do this?
+<input type="submit" value="\$In{action}" name="action">
+<input type="submit" value="No" name="">
+</form>
+EOF
+
+
+# --------------------------
+$Lang{Restore_Requested_on__hostDest} = "BackupPC: Restore Requested on \$hostDest";
+$Lang{Reply_from_server_was___reply} = <<EOF;
+\${h1(\$str)}
+<p>
+Reply from server was: \$reply
+<p>
+Go back to <a href="\$MyURL?host=\$hostDest">\$hostDest home page</a>.
+EOF
+
+# -------------------------
+$Lang{Host__host_Backup_Summary} = "BackupPC: Host \$host Backup Summary";
+
+$Lang{Host__host_Backup_Summary2} = <<EOF;
+\${h1("Host \$host Backup Summary")}
+<p>
+\$warnStr
+<ul>
+\$statusStr
+</ul>
+
+\${h2("User Actions")}
+<p>
+<form action="\$MyURL" method="get">
+<input type="hidden" name="host" value="\$host">
+\$startIncrStr
+<input type="submit" value="$Lang{Start_Full_Backup}" name="action" alt="demarage plein">
+<input type="submit" value="$Lang{Stop_Dequeue_Backup}" name="action">
+</form>
+
+\${h2("Backup Summary")}
+<p>
+Click on the backup number to browse and restore backup files.
+<table border>
+<tr><td align="center"> Backup# </td>
+ <td align="center"> Type </td>
+ <td align="center"> Filled </td>
+ <td align="center"> Start Date </td>
+ <td align="center"> Duration/mins </td>
+ <td align="center"> Age/days </td>
+ <td align="center"> Server Backup Path </td>
+</tr>
+\$str
+</table>
+<p>
+
+\$restoreStr
+
+\${h2("Xfer Error Summary")}
+<p>
+<table border>
+<tr><td align="center"> Backup# </td>
+ <td align="center"> Type </td>
+ <td align="center"> View </td>
+ <td align="center"> #Xfer errs </td>
+ <td align="center"> #bad files </td>
+ <td align="center"> #bad share </td>
+ <td align="center"> #tar errs </td>
+</tr>
+\$errStr
+</table>
+<p>
+
+\${h2("File Size/Count Reuse Summary")}
+<p>
+Existing files are those already in the pool; new files are those added
+to the pool.
+Empty files and SMB errors aren\'t counted in the reuse and new counts.
+<table border>
+<tr><td colspan="2"></td>
+ <td align="center" colspan="3"> Totals </td>
+ <td align="center" colspan="2"> Existing Files </td>
+ <td align="center" colspan="2"> New Files </td>
+</tr>
+<tr>
+ <td align="center"> Backup# </td>
+ <td align="center"> Type </td>
+ <td align="center"> #Files </td>
+ <td align="center"> Size/MB </td>
+ <td align="center"> MB/sec </td>
+ <td align="center"> #Files </td>
+ <td align="center"> Size/MB </td>
+ <td align="center"> #Files </td>
+ <td align="center"> Size/MB </td>
+</tr>
+\$sizeStr
+</table>
+<p>
+
+\${h2("Compression Summary")}
+<p>
+Compression performance for files already in the pool and newly
+compressed files.
+<table border>
+<tr><td colspan="3"></td>
+ <td align="center" colspan="3"> Existing Files </td>
+ <td align="center" colspan="3"> New Files </td>
+</tr>
+<tr><td align="center"> Backup# </td>
+ <td align="center"> Type </td>
+ <td align="center"> Comp Level </td>
+ <td align="center"> Size/MB </td>
+ <td align="center"> Comp/MB </td>
+ <td align="center"> Comp </td>
+ <td align="center"> Size/MB </td>
+ <td align="center"> Comp/MB </td>
+ <td align="center"> Comp </td>
+</tr>
+\$compStr
+</table>
+<p>
+EOF
+
+# -------------------------
+$Lang{Error} = "BackupPC: Error";
+$Lang{Error____head} = <<EOF;
+\${h1("Error: \$head")}
+<p>\$mesg</p>
+EOF
+
+# -------------------------
+$Lang{NavSectionTitle_} = "Server";
+
+# -------------------------
+$Lang{Backup_browse_for__host} = <<EOF;
+\${h1("Backup browse for \$host")}
+
+<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>
+
+<ul>
+<li> You are browsing backup #\$num, which started around \$backupTime
+ (\$backupAge days ago),
+\$filledBackup
+<li> Click on a directory below to navigate into that directory,
+<li> Click on a file below to restore that file.
+</ul>
+
+\${h2("Contents of \${EscapeHTML(\$dirDisplay)}")}
+<form name="form1" method="post" action="\$MyURL">
+<input type="hidden" name="num" value="\$num">
+<input type="hidden" name="host" value="\$host">
+<input type="hidden" name="fcbMax" value="\$checkBoxCnt">
+<input type="hidden" name="action" value="$Lang{Restore}">
+<br>
+<table>
+<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">
+ \$fileHeader
+ \$topCheckAll
+ \$fileStr
+ \$checkAll
+ </table>
+ </td></tr></table>
+<br>
+<!--
+This is now in the checkAll row
+<input type="submit" name="Submit" value="Restore selected files">
+-->
+</td></tr></table>
+</form>
+EOF
+
+# ------------------------------
+$Lang{Restore___num_details_for__host} = "BackupPC: Restore #\$num details for \$host";
+
+$Lang{Restore___num_details_for__host2 } = <<EOF;
+\${h1("Restore #\$num Details for \$host")}
+<p>
+<table border>
+<tr><td> Number </td><td> \$Restores[\$i]{num} </td></tr>
+<tr><td> Requested by </td><td> \$RestoreReq{user} </td></tr>
+<tr><td> Request time </td><td> \$reqTime </td></tr>
+<tr><td> Result </td><td> \$Restores[\$i]{result} </td></tr>
+<tr><td> Error Message </td><td> \$Restores[\$i]{errorMsg} </td></tr>
+<tr><td> Source host </td><td> \$RestoreReq{hostSrc} </td></tr>
+<tr><td> Source backup num </td><td> \$RestoreReq{num} </td></tr>
+<tr><td> Source share </td><td> \$RestoreReq{shareSrc} </td></tr>
+<tr><td> Destination host </td><td> \$RestoreReq{hostDest} </td></tr>
+<tr><td> Destination share </td><td> \$RestoreReq{shareDest} </td></tr>
+<tr><td> Start time </td><td> \$startTime </td></tr>
+<tr><td> Duration </td><td> \$duration min </td></tr>
+<tr><td> Number of files </td><td> \$Restores[\$i]{nFiles} </td></tr>
+<tr><td> Total size </td><td> \${MB} MB </td></tr>
+<tr><td> Transfer rate </td><td> \$MBperSec MB/sec </td></tr>
+<tr><td> TarCreate errors </td><td> \$Restores[\$i]{tarCreateErrs} </td></tr>
+<tr><td> Xfer errors </td><td> \$Restores[\$i]{xferErrs} </td></tr>
+<tr><td> Xfer log file </td><td>
+<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>
+\${h1("File/Directory list")}
+<p>
+<table border>
+<tr><td>Original file/dir</td><td>Restored to</td></tr>
+\$fileListStr
+</table>
+EOF
+
+# -----------------------------------
+$Lang{Email_Summary} = "BackupPC: Email Summary";
+
+# -----------------------------------
+# !! ERROR messages !!
+# -----------------------------------
+$Lang{BackupPC__Lib__new_failed__check_apache_error_log} = "BackupPC::Lib->new failed: check apache error_log\n";
+$Lang{Wrong_user__my_userid_is___} =
+ "Wrong user: my userid is \$>, instead of \$uid"
+ . "(\$Conf{BackupPCUser})\n";
+$Lang{Only_privileged_users_can_view_PC_summaries} = "Only privileged users can view PC summaries.";
+$Lang{Only_privileged_users_can_stop_or_start_backups} =
+ "Only privileged users can stop or start backups on"
+ . " \${EscapeHTML(\$host)}.";
+$Lang{Invalid_number__num} = "Invalid number \$num";
+$Lang{Unable_to_open__file__configuration_problem} = "Unable to open \$file: configuration problem?";
+$Lang{Only_privileged_users_can_view_log_or_config_files} = "Only privileged users can view log or config files.";
+$Lang{Only_privileged_users_can_view_log_files} = "Only privileged users can view log files.";
+$Lang{Only_privileged_users_can_view_email_summaries} = "Only privileged users can view email summaries.";
+$Lang{Only_privileged_users_can_browse_backup_files} = "Only privileged users can browse backup files"
+ . " for host \${EscapeHTML(\$In{host})}.";
+$Lang{Empty_host_name} = "Empty host name.";
+$Lang{Can_t_browse_bad_directory_name} = "Can\'t browse bad directory name"
+ . " \${EscapeHTML(\"\$TopDir/pc/\$host/\$num\")}";
+$Lang{Directory___EscapeHTML} = "Directory \${EscapeHTML(\"\$TopDir/pc/\$host/\$num\")}"
+ . " is empty";
+$Lang{Can_t_browse_bad_directory_name2} = "Can\'t browse bad directory name"
+ . " \${EscapeHTML(\$fullDir)}";
+$Lang{Only_privileged_users_can_restore_backup_files} = "Only privileged users can restore backup files"
+ . " for host \${EscapeHTML(\$In{host})}.";
+$Lang{Bad_host_name} = "Bad host name \${EscapeHTML(\$host)}";
+$Lang{You_haven_t_selected_any_files__please_go_Back_to} = "You haven\'t selected any files; please go Back to"
+ . " select some files.";
+$Lang{Nice_try__but_you_can_t_put} = "Nice try, but you can\'t put \'..\' in any of the file names";
+$Lang{Can_t_fork_for_tar_restore} = "Can\'t fork for tar restore";
+$Lang{Can_t_fork_for_zip_restore} = "Can\'t fork for zip restore";
+$Lang{Host__doesn_t_exist} = "Host \${EscapeHTML(\$In{hostDest})} doesn\'t exist";
+$Lang{You_don_t_have_permission_to_restore_onto_host} = "You don\'t have permission to restore onto host"
+ . " \${EscapeHTML(\$In{hostDest})}";
+$Lang{Can_t_open_create} = "Can\'t open/create "
+ . "\${EscapeHTML(\"\$TopDir/pc/\$hostDest/\$reqFileName\")}";
+$Lang{Only_privileged_users_can_restore_backup_files2} = "Only privileged users can restore backup files"
+ . " for host \${EscapeHTML(\$host)}.";
+$Lang{Empty_host_name} = "Empty host name";
+$Lang{Can_t_restore_bad_file} = "Can\'t restore bad file \${EscapeHTML(\$fullPath)}";
+$Lang{Unknown_host_or_user} = "Unknown host or user \${EscapeHTML(\$host)}";
+$Lang{Only_privileged_users_can_view_information_about} = "Only privileged users can view information about"
+ . " host \${EscapeHTML(\$host)}." ;
+$Lang{Only_privileged_users_can_view_restore_information} = "Only privileged users can view restore information.";
+$Lang{Restore_number__num_for_host__does_not_exist} = "Restore number \$num for host \${EscapeHTML(\$host)} does"
+ . " not exist.";
+
+$Lang{Unable_to_connect_to_BackupPC_server} = "Unable to connect to BackupPC server",
+ "This CGI script (\$MyURL) is unable to connect to the BackupPC"
+ . " server on \$Conf{ServerHost} port \$Conf{ServerPort}. The error"
+ . " was: \$err.",
+ "Perhaps the BackupPC server is not running or there is a "
+ . " configuration error. Please report this to your Sys Admin.";
+
+$Lang{Can_t_find_IP_address_for} = "Can\'t find IP address for \${EscapeHTML(\$host)}";
+
+$Lang{host_is_a_DHCP_host} = <<EOF;
+\$host is a DHCP host, and I don\'t know its IP address. I checked the
+netbios name of \$ENV{REMOTE_ADDR}\$tryIP, and found that that machine
+is not \$host.
+<p>
+Until I see \$host at a particular DHCP address, you can only
+start this request from the client machine itself.
+EOF
+
+# ------------------------------------
+# !! Server Mesg !!
+# ------------------------------------
+
+# do not translate the firsts, used by server
+$Lang{backup__In_hostIP___host} = "backup \$In{hostIP} \$host"
+ . " \$User \$doFull";
+$Lang{backup__host__host__User__doFull} = "backup \$host \$host \$User \$doFull";
+$Lang{restore__ipAddr} = "restore \$ipAddr"
+ . " \$hostDest \$User \$reqFileName";
+$Lang{stop__host__User__In_backoff} = "stop \$host \$User \$In{backoff}";
+
+########################
+# ok you can do it then
+########################
+
+$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{log_Can_t_fork_for_tar_restore_request_by__User} = "log Can\'t fork for tar restore request by \$User";
+$Lang{log_User__User_downloaded_tar_archive_for__host} = "log User \$User downloaded tar archive for \$host,"
+ . " backup \$num; files were: "
+ . " \${join(\", \", \@fileListTrim)}";
+
+$Lang{log_Can_t_fork_for_zip_restore_request_by__User} = "log Can\'t fork for zip restore request by \$User";
+
+$Lang{log_User__User_downloaded_zip_archive_for__host}= "log User \$User downloaded zip archive for \$host,"
+ . " backup \$num; files were: "
+ . "\${join(\", \", \@fileListTrim)}";
+
+$Lang{Restore_requested_to_host__hostDest__backup___num} = "Restore requested to host \$hostDest, backup #\$num,"
+ . " by \$User from \$ENV{REMOTE_ADDR}";
+
+# -------------------------------------------------
+# ------- Stuff that was forgotten ----------------
+# -------------------------------------------------
+
+$Lang{Status} = "Status";
+$Lang{PC_Summary} = "PC Summary";
+$Lang{LOG_file} = "LOG file";
+$Lang{Old_LOGs} = "Old LOGs";
+$Lang{Email_summary} = "Email summary";
+$Lang{Config_file} = "Config file";
+$Lang{Hosts_file} = "Hosts file";
+$Lang{Current_queues} = "Current queues";
+$Lang{Documentation} = "Documentation";
+
+$Lang{Host_or_User_name} = "<small>Host or User name:</small>";
+$Lang{Go} = "Go";
+$Lang{Hosts} = "Hosts";
+
+$Lang{This_PC_has_never_been_backed_up} = "<h2> This PC has never been backed up!! </h2>\n";
+$Lang{This_PC_is_used_by} = "<li>This PC is used by \${UserLink(\$user)}";
+
+# ------------
+$Lang{Last_email_sent_to__was_at___subject} = <<EOF;
+<li>Last email sent to \${UserLink(\$user)} was at \$mailTime, subject "\$subj".
+EOF
+# ------------
+$Lang{The_command_cmd_is_currently_running_for_started} = <<EOF;
+<li>The command \$cmd is currently running for \$host, started \$startTime.
+EOF
+
+# -----------
+$Lang{Host_host_is_queued_on_the_background_queue_will_be_backed_up_soon} = <<EOF;
+<li>Host \$host is queued on the background queue (will be backed up soon).
+EOF
+
+# ----------
+$Lang{Host_host_is_queued_on_the_user_queue__will_be_backed_up_soon} = <<EOF;
+<li>Host \$host is queued on the user queue (will be backed up soon).
+EOF
+
+# ---------
+$Lang{A_command_for_host_is_on_the_command_queue_will_run_soon} = <<EOF;
+<li>A command for \$host is on the command queue (will run soon).
+EOF
+
+# --------
+$Lang{Last_status_is_state_StatusHost_state_reason_as_of_startTime} = <<EOF;
+<li>Last status is state \"\$StatusHost{state}\"\$reason
+ as of \$startTime.
+EOF
+
+# --------
+$Lang{Last_error_is____EscapeHTML_StatusHost_error} = <<EOF;
+<li>Last error is \"\${EscapeHTML(\$StatusHost{error})}\"
+EOF
+
+# ------
+$Lang{Pings_to_host_have_failed_StatusHost_deadCnt__consecutive_times} = <<EOF;
+<li>Pings to \$host have failed \$StatusHost{deadCnt} consecutive times.
+EOF
+
+# -----
+$Lang{Prior_to_that__pings} = "Prior to that, pings";
+
+# -----
+$Lang{priorStr_to_host_have_succeeded_StatusHostaliveCnt_consecutive_times} = <<EOF;
+<li>\$priorStr to \$host have succeeded \$StatusHost{aliveCnt}
+ consecutive times.
+EOF
+
+$Lang{Because__host_has_been_on_the_network_at_least__Conf_BlackoutGoodCnt_consecutive_times___} = <<EOF;
+<li>Because \$host has been on the network at least \$Conf{BlackoutGoodCnt}
+consecutive times, it will not be backed up from \$t0 to \$t1 on \$days.
+EOF
+
+$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>).
+EOF
+
+$Lang{info_jobs_hosts_queueLen} = "info jobs hosts queueLen";
+
+$Lang{tryIP} = " and \$StatusHost{dhcpHostIP}";
+
+$Lang{Host_Inhost} = "Host \$In{host}";
+
+$Lang{checkAll} = <<EOF;
+<tr bgcolor="#ffffcc"><td>
+<input type="checkbox" name="allFiles" onClick="return checkAll('allFiles');"> Select all
+</td><td colspan="4" align="center">
+<input type="submit" name="Submit" value="Restore selected files">
+</td></tr>
+EOF
+
+$Lang{fileHeader} = <<EOF;
+ <tr bgcolor="\$Conf{CgiHeaderBgColor}"><td align=center> Name</td>
+ <td align="center"> Type</td>
+ <td align="center"> Mode</td>
+ <td align="center"> Size</td>
+ <td align="center"> Mod time</td>
+ </tr>
+EOF
+
+$Lang{Home} = "Home";
+$Lang{Last_bad_XferLOG} = "Last bad XferLOG";
+$Lang{Last_bad_XferLOG_errors_only} = "Last bad XferLOG (errors only)";
+
+$Lang{This_display_is_merged_with_backup} = <<EOF;
+<li> This display is merged with backup #\$numF, the most recent prior
+ filled (full) dump.
+EOF
+
+$Lang{Restore_Summary} = <<EOF;
+\${h2("Restore Summary")}
+<p>
+Click on the restore number for more details.
+<table border>
+<tr><td align="center"> Restore# </td>
+ <td align="center"> Result </td>
+ <td align="right"> Start Date</td>
+ <td align="right"> Dur/mins</td>
+ <td align="right"> #files </td>
+ <td align="right"> MB </td>
+ <td align="right"> #tar errs </td>
+ <td align="right"> #xferErrs </td>
+</tr>
+\$restoreStr
+</table>
+<p>
+EOF
+
+$Lang{BackupPC__Documentation} = "BackupPC: Documentation";
+
+$Lang{No} = "no";
+$Lang{Yes} = "yes";
+
+$Lang{The_directory_is_empty} = <<EOF;
+<tr><td bgcolor="#ffffff">The directory \${EscapeHTML(\$dirDisplay)} is empty
+</td></tr>
+EOF
+
+$Lang{on} = "on";
+$Lang{off} = "off";
+
+$Lang{full} = "full";
+$Lang{incremental} = "incr";
+
+$Lang{failed} = "failed";
+$Lang{success} = "success";
+$Lang{and} = "and";
+
+#end of lang_en.pm
--- /dev/null
+#!/usr/bin/perl -w
+
+#my %lang;
+#use strict;
+
+# --------------------------------
+
+$Lang{Start_Full_Backup} = "Démarrer sauvegarde complète";
+$Lang{Start_Incr_Backup} = "Départ de la sauvegarde incrémentale";
+$Lang{Stop_Dequeue_Backup} = "Arrêter/annuler sauvegarde";
+$Lang{Restore} = "Restore";
+
+# -----
+
+$Lang{H_BackupPC_Server_Status} = "Status du serveur BackupPC";
+$Lang{BackupPC_Server_Status}= <<EOF;
+
+\${h1(qq{$Lang{H_BackupPC_Server_Status}})}
+<p>
+\${h2(\"Informations Générales du serveur\")}
+
+<ul>
+<li> Le PID du serveur est \$Info{pid}, sur l\'hôte \$Conf{ServerHost},
+ version \$Info{Version}, démarré le \$serverStartTime.
+<li> Ce rapport à été généré le \$now.
+<li> La prochaine file d\'attente sera remplie le \$nextWakeupTime.
+<li> Autres info:
+ <ul>
+ <li>\$numBgQueue demandes de sauvegardes en attente depuis le dernier réveil automatique,
+ <li>\$numUserQueue requêtes de sauvegardes utilisateur en attente,
+ <li>\$numCmdQueue requêtes de commandes en attente,
+ \$poolInfo
+ <li>L\'espace de stockage a été récemment rempli à \$Info{DUlastValue}%
+ (\$DUlastTime), le maximum d\'aujourd\'hui est \$Info{DUDailyMax}% (\$DUmaxTime)
+ et hier le maximum était \$Info{DUDailyMaxPrev}%.
+ </ul>
+</ul>
+
+\${h2("Travaux en cours d'exécution")}
+<p>
+<table border>
+<tr><td> Hôte </td>
+ <td> Type </td>
+ <td> Utilisateur </td>
+ <td> Date de départ </td>
+ <td> Commande </td>
+ <td align="center"> PID </td>
+ <td> Xfer PID </td>
+ \$tarPidHdr</tr>
+\$jobStr
+</table>
+<p>
+
+\${h2("Échecs qui demandent de l'attention")}
+<p>
+<table border>
+<tr><td align="center"> Hôte </td>
+ <td align="center"> Type </td>
+ <td align="center"> Utilisateur </td>
+ <td align="center"> Dernier essai </td>
+ <td align="center"> Détails </td>
+ <td align="center"> Date d\'erreur </td>
+ <td> Dernière erreur (autre que pas de ping) </td></tr>
+\$statusStr
+</table>
+EOF
+
+# --------------------------------
+$Lang{BackupPC__Server_Summary} = "BackupPC: Résumé du serveur";
+$Lang{BackupPC_Summary}=<<EOF;
+
+\${h1(qq{$Lang{BackupPC__Server_Summary}})}
+<p>
+Ce statut a été généré le \$now.
+<p>
+
+\${h2("Hôtes avec de bonnes sauvegardes")}
+<p>
+Il y a \$hostCntGood hôtes ayant été sauvegardés, avec un total de :
+<ul>
+<li> \$fullTot sauvegardes complètes de tailles cumulées \${fullSizeTot} Go
+ (précédant le hachage et la compression),
+<li> \$incrTot sauvegardes incrémentales de tailles cumulées \${incrSizeTot} Go
+ (précédant le hachage et la compression).
+</ul>
+<table border>
+<tr><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"> complètes Taille/Go </td>
+ <td align="center"> Vitesse Mo/sec </td>
+ <td align="center"> nb incrémentales </td>
+ <td align="center"> Incr Age/Jours </td>
+ <td align="center"> État actuel</td>
+ <td align="center"> Dernière tentative </td></tr>
+\$strGood
+</table>
+<p>
+
+\${h2("Hôtes sans sauvegardes")}
+<p>
+Il y a \$hostCntNone hôtes sans sauvegardes.
+<p>
+<table border>
+<tr><td> Hôte </td>
+ <td align="center"> Utilisateur </td>
+ <td align="center"> Nb complètes </td>
+ <td align="center"> Complètes Age/jour </td>
+ <td align="center"> Complètes Taille/Go </td>
+ <td align="center"> Vitesse Mo/sec </td>
+ <td align="center"> Nb incrémentales </td>
+ <td align="center"> Incrémentales Age/jours </td>
+ <td align="center"> État actuel </td>
+ <td align="center"> Dernière tentative </td></tr>
+\$strNone
+</table>
+EOF
+
+# -----------------------------------
+$Lang{Pool_Stat} = <<EOF;
+ <li>Le disque dispose de \${poolSize} Go avec \$info->{"\${name}FileCnt"} fichiers
+ et \$info->{"\${name}DirCnt"} repertoires (depuis le \$poolTime),
+ <li>Le hachage des fichiers donne \$info->{"\${name}FileCntRep"} fichiers répétés
+ avec comme plus longue chaîne \$info->{"\${name}FileRepMax"},
+ <li>Le nettoyage nocturne a effacé \$info->{"\${name}FileCntRm"} fichiers, soit
+ \${poolRmSize} Go (vers \$poolTime),
+EOF
+
+# -----------------------------------
+$Lang{BackupPC__Backup_Requested_on__host} = "BackupPC: Sauvegarde demandée sur \$host";
+# --------------------------------
+$Lang{REPLY_FROM_SERVER} = <<EOF;
+\${h1(\$str)}
+<p>
+La réponse du serveur a été: \$reply
+<p>
+Retourner à la page d\'accueil de <a href="\$MyURL?host=\$host">\$host</a>.
+EOF
+# --------------------------------
+$Lang{BackupPC__Start_Backup_Confirm_on__host} = "BackupPC: Confirmation du départ de la sauvegarde de \$host";
+# --------------------------------
+$Lang{Are_you_sure_start} = <<EOF;
+\${h1("Êtes vous sur")}
+<p>
+Vous allez bientôt démarrer une sauvegarde <i>\$type</i> depuis \$host.
+
+<form action="\$MyURL" method="get">
+<input type="hidden" name="host" value="\$host">
+<input type="hidden" name="hostIP" value="\$ipAddr">
+<input type="hidden" name="doit" value="1">
+Voulez vous vraiment le faire ?
+<input type="submit" value="\$In{action}" name="action">
+<input type="submit" value="Non" name="">
+</form>
+EOF
+# --------------------------------
+$Lang{BackupPC__Stop_Backup_Confirm_on__host} = "BackupPC: Confirmer l\'arrêt de la sauvegarde sur \$host";
+# --------------------------------
+$Lang{Are_you_sure_stop} = <<EOF;
+
+\${h1("Êtes vous sur ?")}
+
+<p>
+Vous êtes sur le point d\'arrêter/supprimer de la file les sauvegardes de \$host;
+
+<form action="\$MyURL" method="get">
+<input type="hidden" name="host" value="\$host">
+<input type="hidden" name="doit" value="1">
+En outre, prière de ne pas démarrer d\'autres sauvegarde avant
+<input type="text" name="backoff" size="10" value="\$backoff"> heures.
+<p>
+Voulez vous vraiment le faire ?
+<input type="submit" value="\$In{action}" name="action">
+<input type="submit" value="Non" name="">
+</form>
+
+EOF
+# --------------------------------
+$Lang{Only_privileged_users_can_view_queues_} = "Seuls les utilisateurs privilégiés peuvent voir les files.";
+# --------------------------------
+$Lang{BackupPC__Queue_Summary} = "BackupPC: Résumé de la file";
+# --------------------------------
+$Lang{Backup_Queue_Summary} = <<EOF;
+\${h1("Résumé de la file")}
+<p>
+\${h2("Résumé des files des utilisateurs")}
+<p>
+Les demandes utilisateurs suivantes sont actuellement en attente :
+<table border>
+<tr><td> Hôte </td>
+ <td> Temps Requis </td>
+ <td> Utilisateur </td></tr>
+\$strUser
+</table>
+<p>
+
+\${h2("Résumé de la file en arrière plan")}
+<p>
+Les demandes en arrière plan suivantes sont actuellement en attente :
+<table border>
+<tr><td> Hôte </td>
+ <td> Temps requis </td>
+ <td> Utilisateur </td></tr>
+\$strBg
+</table>
+<p>
+
+\${h2("Résumé de la file d\'attente des commandes")}
+<p>
+Les demandes de commande suivantes sont actuellement en attente :
+<table border>
+<tr><td> Hôtes </td>
+ <td> Temps Requis </td>
+ <td> Utilisateur </td>
+ <td> Commande </td></tr>
+\$strCmd
+</table>
+EOF
+# --------------------------------
+$Lang{Backup_PC__Log_File__file} = "BackupPC: Fichier de log \$file";
+$Lang{Log_File__file__comment} = <<EOF;
+"Fichier de log \$file \$comment";
+<p>
+EOF
+# --------------------------------
+$Lang{Contents_of_log_file} = <<EOF;
+Contenu du fichier de log <tt>\$file</tt>, modifié le \$mtimeStr \$comment
+EOF
+
+# --------------------------------
+$Lang{skipped__skipped_lines} = "[ \$skipped lignes sautées ]\n";
+# --------------------------------
+$Lang{_pre___Can_t_open_log_file__file} = "<pre>\nNe peut pas ouvrir le fichier de log \$file\n";
+
+# --------------------------------
+$Lang{BackupPC__Log_File_History} = "BackupPC: Historique du fichier de log";
+$Lang{Log_File_History__hdr} = <<EOF;
+\${h1("Historique du fichier de log \$hdr")}
+<p>
+<table border>
+<tr><td align="center"> Fichier </td>
+ <td align="center"> Taille </td>
+ <td align="center"> Date de modification </td></tr>
+\$str
+</table>
+EOF
+
+# -------------------------------
+$Lang{Recent_Email_Summary} = <<EOF;
+\${h1("Résumé des emails récents (Du plus récent au plus vieux)")}
+<p>
+<table border>
+<tr><td align="center"> Recipient </td> <!-- FIXME -->
+ <td align="center"> Hôte </td>
+ <td align="center"> Date </td>
+ <td align="center"> Sujet </td></tr>
+\$str
+</table>
+EOF
+
+
+# ------------------------------
+$Lang{Browse_backup__num_for__host} = "BackupPC: Navigation dans la sauvegarde \$num de \$host";
+
+# ------------------------------
+$Lang{Restore_Options_for__host} = "BackupPC: Options de restauration sur \$host";
+$Lang{Restore_Options_for__host2} = <<EOF;
+<p>
+Vous avez sélectionné les fichiers/repertoires suivants depuis le partage
+\$share, sauvegarde numéro \$num:
+<ul>
+\$fileListStr
+</ul>
+<p>
+Vous avez trois choix pour restaurer ces fichiers/repertoires.
+Veuillez sélectionner une des options suivantes.
+<p>
+\${h2("Option 1: Restauration directe")}
+<p>
+Vous pouvez démarrer une restauration qui va restaurer ces fichiers
+directement sur \$host.
+<p>
+<b>Attention:</b>
+tout les fichiers correspondant à ceux que vous avez sélectionnés vont être effacés !
+
+<form action="\$MyURL" method="post">
+<input type="hidden" name="host" value="\${EscapeHTML(\$host)}">
+<input type="hidden" name="num" value="\$num">
+<input type="hidden" name="type" value="3">
+\$hiddenStr
+<input type="hidden" value="\$In{action}" name="action">
+<table border="0">
+<tr>
+ <td>Restaurer les fichiers vers l\'hôte</td>
+ <td><input type="text" size="40" value="\${EscapeHTML(\$host)}"
+ name="hostDest"></td>
+</tr><tr>
+ <td>Restaurer les fichiers vers le partage</td>
+ <td><input type="text" size="40" value="\${EscapeHTML(\$share)}"
+ name="shareDest"></td>
+</tr><tr>
+ <td>Restaurer les fichiers du répertoire<br>(relatif au partage)</td>
+ <td valign="top"><input type="text" size="40" maxlength="256"
+ value="\${EscapeHTML(\$pathHdr)}" name="pathHdr"></td>
+</tr><tr>
+ <td><input type="submit" value="Démarrer la restauration" name=""></td>
+</table>
+</form>
+EOF
+
+
+# ------------------------------
+$Lang{Option_2__Download_Zip_archive} = <<EOF;
+
+\${h2("Option 2: Télécharger l\'archive compressée")}
+<p>
+Vous pouvez télécharger une archive zippée contenant tous les fichiers/répertoires que vous
+avez sélectionnés. Vous pouvez utiliser une application locale, comme <i>Winzip</i>, pour
+voir ou extraire n\'importe quel fichier.
+<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>
+<form action="\$MyURL" method="post">
+<input type="hidden" name="host" value="\${EscapeHTML(\$host)}">
+<input type="hidden" name="num" value="\$num">
+<input type="hidden" name="type" value="2">
+\$hiddenStr
+<input type="hidden" value="\$In{action}" name="action">
+<input type="checkbox" value="1" name="relative" checked> Faire l\'archive relative à
+\${EscapeHTML(\$pathHdr eq "" ? "/" : \$pathHdr)}
+(Autrement l\'archive contiendra les chemins complets).
+<br>
+Compression (0=désactivée, 1=rapide,...,9=meilleure)
+<input type="text" size="6" value="5" name="compressLevel">
+<br>
+<input type="submit" value="Télécharger le fichier zippé" name="">
+</form>
+EOF
+
+
+# ------------------------------
+
+$Lang{Option_2__Download_Zip_archive2} = <<EOF;
+\${h2("Option 2: Télécharger une archive zippée")}
+<p>
+Vous pouvez télécharger une archive zippée, mais Archive::Zip n\'est pas
+installé. Vous pouvez demander à votre administrateur système d\'installer
+Archive::Zip depuis <a href="http://www.cpan.org">www.cpan.org</a>.
+<p>
+EOF
+
+
+# ------------------------------
+$Lang{Option_3__Download_Zip_archive} = <<EOF;
+\${h2("Option 3: Télécharger une archive tar")}
+<p>
+
+Vous pouvez télécharger une archive Tar contenant tous les fichiers/répertoires
+que vous avez sélectionnés. Vous pouvez alors utiliser une application locale,
+comme <i>tar</i> ou <i>winzip</i> pour voir ou extraire n\'importe quel fichier.
+<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 beaucoup de temps
+(plusieurs minutes) pour créer et transfèrer l\'archive, et vous aurez besoin de beaucoup
+d\'espace disque local pour le stocker.
+<p>
+<form action="\$MyURL" method="post">
+<input type="hidden" name="host" value="\${EscapeHTML(\$host)}">
+<input type="hidden" name="num" value="\$num">
+<input type="hidden" name="type" value="1">
+\$hiddenStr
+<input type="hidden" value="\$In{action}" name="action">
+<input type="checkbox" value="1" name="relative" checked> Faire l\'archive relative à
+\${EscapeHTML(\$pathHdr eq "" ? "/" : \$pathHdr)}
+(Autrement l\'archive contiendra des chemins absolus).
+<br>
+<input type="submit" value="Télécharger le fichier Tar" name="">
+</form>
+EOF
+
+
+
+# ------------------------------
+$Lang{Restore_Confirm_on__host} = "BackupPC: Confirmation de restauration sur \$host";
+
+$Lang{Are_you_sure} = <<EOF;
+\${h1("Êtes-vous sur ?")}
+<p>
+Vous êtes sur le point de démarrer une restauration directement sur la machine
+\$In{hostDest}.
+Les fichiers suivants vont être restaurés dans le partage \$In{shareDest}, depuis
+la sauvegarde numéro \$num:
+<p>
+<table border>
+<tr><td>Fichier/Répertoire original</td><td>Va être restauré à</td></tr>
+\$fileListStr
+</table>
+
+<form action="\$MyURL" method="post">
+<input type="hidden" name="host" value="\${EscapeHTML(\$host)}">
+<input type="hidden" name="hostDest" value="\${EscapeHTML(\$In{hostDest})}">
+<input type="hidden" name="shareDest" value="\${EscapeHTML(\$In{shareDest})}">
+<input type="hidden" name="pathHdr" value="\${EscapeHTML(\$In{pathHdr})}">
+<input type="hidden" name="num" value="\$num">
+<input type="hidden" name="type" value="4">
+\$hiddenStr
+Voulez-vous vraiment le faire ?
+<input type="submit" value="\$In{action}" name="action">
+<input type="submit" value="Non" name="">
+</form>
+EOF
+
+# --------------------------
+$Lang{Restore_Requested_on__hostDest} = "BackupPC: Restauration demandée sur \$hostDest";
+$Lang{Reply_from_server_was___reply} = <<EOF;
+\${h1(\$str)}
+<p>
+La réponse du serveur est: \$reply
+<p>
+Retourner à la page d\'acceuil de <a href="\$MyURL?host=\$hostDest">\$hostDest </a>.
+EOF
+
+
+# -------------------------
+$Lang{Host__host_Backup_Summary} = "BackupPC: Résumé de la sauvegarde de l\'hôte \$host ";
+
+$Lang{Host__host_Backup_Summary2} = <<EOF;
+\${h1("Résumé de la sauvegarde de l\'hôte \$host ")}
+<p>
+\$warnStr
+<ul>
+\$statusStr
+</ul>
+
+\${h2("Actions de l\'utilisateur")}
+<p>
+<form action="\$MyURL" method="get">
+<input type="hidden" name="host" value="\$host">
+\$startIncrStr
+<input type="submit" value="$Lang{Start_Full_Backup}" name="action">
+<input type="submit" value="$Lang{Stop_Dequeue_Backup}" name="action">
+</form>
+
+\${h2("Résumé de la sauvegarde")}
+<p>
+Cliquer sur le numéro de l\'archive pour naviguer et restaurer les fichiers de sauvegarde.
+<table border>
+<tr><td align="center"> Sauvegarde n° </td>
+ <td align="center"> Type </td>
+ <td align="center"> terminée </td>
+ <td align="center"> Date de démarrage </td>
+ <td align="center"> Durée/mins </td>
+ <td align="center"> Age/jours </td>
+ <td align="center"> Chemin d\'accès sauvegarde sur serveur </td>
+</tr>
+\$str
+</table>
+<p>
+
+\$restoreStr
+
+\${h2("Résumé des erreurs de transfert")}
+<p>
+<table border>
+<tr><td align="center"> Nb sauvegarde </td>
+ <td align="center"> Type </td>
+ <td align="center"> View </td> <!-- FIXME -->
+ <td align="center"> Nb erreurs transfert </td>
+ <td align="center"> Nb mauvais fichiers </td>
+ <td align="center"> Nb mauvais partages </td>
+ <td align="center"> Nb erreurs tar </td>
+</tr>
+\$errStr
+</table>
+<p>
+
+\${h2("Résumé de Taille fichier/Nombre de réutilisations")}
+<p>
+ Les fichiers existants sont ceux qui sont déjà sur le serveur;
+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.
+
+<table border>
+<tr><td colspan="2"></td>
+ <td align="center" colspan="3"> Totaux </td>
+ <td align="center" colspan="2"> Fichiers existants </td>
+ <td align="center" colspan="2"> Nouveaux fichiers </td>
+</tr>
+<tr>
+ <td align="center"> Nb de sauvegarde </td>
+ <td align="center"> Type </td>
+ <td align="center"> Nb de Fichiers </td>
+ <td align="center"> Taille/Mo </td>
+ <td align="center"> Mo/sec </td>
+ <td align="center"> Nb de Fichiers </td>
+ <td align="center"> Taille/MB </td>
+ <td align="center"> Nb de Fichiers </td>
+ <td align="center"> Taille/Mo </td>
+</tr>
+\$sizeStr
+</table>
+<p>
+
+\${h2("Résumé de la compression")}
+<p>
+
+Performance de compression pour les fichiers déjà sur le serveur et
+récemment compressés.
+
+<table border>
+<tr><td colspan="3"></td>
+ <td align="center" colspan="3"> Fichiers existants </td>
+ <td align="center" colspan="3"> Nouveaux fichiers </td>
+</tr>
+<tr><td align="center"> Nb de sauvegardes </td>
+ <td align="center"> Type </td>
+ <td align="center"> Niveau de Compression </td>
+ <td align="center"> Taille/Mo </td>
+ <td align="center"> Comp/Mo </td>
+ <td align="center"> Comp </td>
+ <td align="center"> Taille/Mo </td>
+ <td align="center"> Comp/Mo </td>
+ <td align="center"> Compression </td>
+</tr>
+\$compStr
+</table>
+<p>
+EOF
+
+# -------------------------
+$Lang{Error} = "BackupPC: Erreur";
+$Lang{Error____head} = <<EOF;
+\${h1("Erreur: \$head")}
+<p>\$mesg</p>
+EOF
+
+# -------------------------
+$Lang{NavSectionTitle_} = "Serveur";
+
+
+# -------------------------
+$Lang{Backup_browse_for__host} = <<EOF;
+\${h1("Navigation dans la sauvegarde pour \$host")}
+
+<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>
+
+<ul>
+<li> Vous naviguez dans la sauvegarde n°\$num, qui a commencé vers \$backupTime
+ (il y a \$backupAge jours),
+\$filledBackup
+<li> Cliquer dans un répertoire ci-dessous pour naviguer dedans,
+<li> Cliquer dans un fichier ci-dessous pour le restaurer..
+</ul>
+
+\${h2("Contenu de \${EscapeHTML(\$dirDisplay)}")}
+<form name="form1" method="post" action="\$MyURL">
+<input type="hidden" name="num" value="\$num">
+<input type="hidden" name="host" value="\$host">
+<input type="hidden" name="fcbMax" value="\$checkBoxCnt">
+<input type="hidden" name="action" value="$Lang{Restore}">
+<br>
+<table>
+<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">
+ \$fileHeader
+ \$topCheckAll
+ \$fileStr
+ \$checkAll
+ </table>
+ </td></tr></table>
+<br>
+<!--
+This is now in the checkAll row
+<input type="submit" name="Submit" value="Restore selected files">
+-->
+</td></tr></table>
+</form>
+EOF
+
+
+# ------------------------------
+
+# FIXME
+$Lang{Restore___num_details_for__host} = "BackupPC: Restore #\$num details for \$host";
+
+$Lang{Restore___num_details_for__host2 } = <<EOF;
+
+# FIXME
+\${h1("Restore #\$num Details for \$host")}
+<p>
+<table border>
+<tr><td> Number </td><td> \$Restores[\$i]{num} </td></tr>
+<tr><td> Requested by </td><td> \$RestoreReq{user} </td></tr>
+<tr><td> Request time </td><td> \$reqTime </td></tr>
+<tr><td> Result </td><td> \$Restores[\$i]{result} </td></tr>
+<tr><td> Error Message </td><td> \$Restores[\$i]{errorMsg} </td></tr>
+<tr><td> Source host </td><td> \$RestoreReq{hostSrc} </td></tr>
+<tr><td> Source backup num </td><td> \$RestoreReq{num} </td></tr>
+<tr><td> Source share </td><td> \$RestoreReq{shareSrc} </td></tr>
+<tr><td> Destination host </td><td> \$RestoreReq{hostDest} </td></tr>
+<tr><td> Destination share </td><td> \$RestoreReq{shareDest} </td></tr>
+<tr><td> Start time </td><td> \$startTime </td></tr>
+<tr><td> Duration </td><td> \$duration min </td></tr>
+<tr><td> Number of files </td><td> \$Restores[\$i]{nFiles} </td></tr>
+<tr><td> Total size </td><td> \${MB} Mo </td></tr>
+<tr><td> Transfer rate </td><td> \$MBperSec Mo/sec </td></tr>
+<tr><td> TarCreate errors </td><td> \$Restores[\$i]{tarCreateErrs} </td></tr>
+<tr><td> Xfer errors </td><td> \$Restores[\$i]{xferErrs} </td></tr>
+<tr><td> Xfer log file </td><td>
+<a href="\$MyURL?action=view&type=RestoreLOG&num=\$Restores[\$i]{num}&host=\$host">View</a>, <!-- FIXME -->
+<a href="\$MyURL?action=view&type=RestoreErr&num=\$Restores[\$i]{num}&host=\$host">Erreurs</a>
+</tr></tr>
+</table>
+<p>
+\${h1("Liste Fichiers/Répertoires")}
+<p>
+<table border>
+<tr><td>Fichier/répertoire original</td><td>Restauré vers</td></tr>
+\$fileListStr
+</table>
+EOF
+
+
+# -----------------------------------
+$Lang{Email_Summary} = "BackupPC: Résumé du courrier électronique";
+
+# -----------------------------------
+# !! ERROR messages !!
+# -----------------------------------
+
+$Lang{BackupPC__Lib__new_failed__check_apache_error_log} = "BackupPC::Lib->new a échoué: regardez le "
+ ."fichier error_log d\'apache\n";
+$Lang{Wrong_user__my_userid_is___} =
+ "Mauvais utilisateur: mon userid est \$>, à la place de \$uid"
+ . "(\$Conf{BackupPCUser})\n";
+$Lang{Only_privileged_users_can_view_PC_summaries} = "Seuls les utilisateurs privilégiés peuvent "
+ . "voir les résumés des PC.";
+$Lang{Only_privileged_users_can_stop_or_start_backups} =
+ "Seuls les utilisateurs privilégiés peuvent arrêter ou démarrer des sauvegardes sur"
+ . " \${EscapeHTML(\$host)}.";
+$Lang{Invalid_number__num} = "Numéro invalide \$num";
+$Lang{Unable_to_open__file__configuration_problem} = "Impossible d\'ouvrir \$file: un problème de configuration ?";
+$Lang{Only_privileged_users_can_view_log_or_config_files} = "Seuls les utilisateurs privilégiés peuvent voir "
+ ."les log ou les fichiers de configuration.";
+$Lang{Only_privileged_users_can_view_log_files} = "Seuls les utilisateurs privilégiés peuvent voir les fichiers de log.";
+$Lang{Only_privileged_users_can_view_email_summaries} = "Seuls les utilisateurs privilégiés peuvent "
+ ."voir les compte-rendu des courriers électroniques.";
+$Lang{Only_privileged_users_can_browse_backup_files} = "Seuls les utilisateurs privilégiés peuvent parcourir "
+ . "les fichiers de sauvegarde pour l'hôte \${EscapeHTML(\$In{host})}.";
+$Lang{Empty_host_name} = "Nom d\'hôte vide.";
+$Lang{Can_t_browse_bad_directory_name} = "Ne peut pas parcourir "
+ . " \${EscapeHTML(\"\$TopDir/pc/\$host/\$num\")}:"
+ . " mauvais nom de répertoire";
+$Lang{Directory___EscapeHTML} = "Le répertoire \${EscapeHTML(\"\$TopDir/pc/\$host/\$num\")}"
+ . " est vide";
+$Lang{Can_t_browse_bad_directory_name2} = "Ne peut pas parcourir "
+ . " \${EscapeHTML(\$fullDir)}:"
+ . " mauvais nom de répertoire";
+$Lang{Only_privileged_users_can_restore_backup_files} = "Seuls les utilisateurs privilégiés peuvent restaurer "
+ . " des fichiers de sauvegarde"
+ . " pour l\'hôte \${EscapeHTML(\$In{host})}.";
+$Lang{Bad_host_name} = "Mauvais nom d\'hôte \${EscapeHTML(\$host)}";
+$Lang{You_haven_t_selected_any_files__please_go_Back_to} = "Vous n'avez sélectionné aucun fichier; "
+ . "vous pouvez revenir en arrière pour sélectionner des fichiers.";
+$Lang{Nice_try__but_you_can_t_put} = "Bien tenté, mais vous ne pouvez pas mettre \'..\' dans"
+ . " n\'importe quel nom de fichier.";
+$Lang{Can_t_fork_for_tar_restore} = "Ne peut pas se dupliquer (fork) pour la restauration par tar";
+$Lang{Can_t_fork_for_zip_restore} = "Ne peut pas se dupliquer (fork) pour la restauration par zip";
+$Lang{Host__doesn_t_exist} = "L'hôte \${EscapeHTML(\$In{hostDest})} n\'existe pas.";
+$Lang{You_don_t_have_permission_to_restore_onto_host} = "Vous n\'avez pas la permission de restaurer sur l\'hôte"
+ . " \${EscapeHTML(\$In{hostDest})}";
+$Lang{Can_t_open_create} = "Ne peut pas ouvrir/créer "
+ . "\${EscapeHTML(\"\$TopDir/pc/\$hostDest/\$reqFileName\")}";
+$Lang{Only_privileged_users_can_restore_backup_files2} = "Seuls les utilisateurs privilégiés peuvent restaurer"
+ . " des fichiers de sauvegarde"
+ . " pour l\'hôte \${EscapeHTML(\$host)}.";
+$Lang{Empty_host_name} = "Nom d\'hôte vide";
+$Lang{Can_t_restore_bad_file} = "Ne peut pas restaurer le fichier corrompu \${EscapeHTML(\$fullPath)}";
+$Lang{Unknown_host_or_user} = "\${EscapeHTML(\$host)}, hôte ou utilisateur inconnu.";
+$Lang{Only_privileged_users_can_view_information_about} = "Seuls les utilisateurs privilégiés peuvent accéder aux "
+ . " informations sur l\'hôte \${EscapeHTML(\$host)}." ;
+$Lang{Only_privileged_users_can_view_restore_information} = "Seuls les utilisateurs privilégiés peuvent restaurer "
+ ."des informations.";
+$Lang{Restore_number__num_for_host__does_not_exist} = "Restauration numéro \$num de l\'hôte \${EscapeHTML(\$host)} n\'"
+ . "existe pas";
+
+$Lang{Unable_to_connect_to_BackupPC_server} = "Impossible de se connecter au server BackupPC."
+ . "Ce script CGI (\$MyURL) ne peut pas se connecter au serveur BackupPC"
+ . " sur \$Conf{ServerHost} via le port \$Conf{ServerPort}. L\'erreur est la"
+ . " suivante: \$err.",
+ "Peut être BackupPC n\'a pas été lancé ou il y a une erreur "
+ . " de configuration. Vous pouvez faire suivre ce message à votre administrateur système.";
+
+$Lang{Can_t_find_IP_address_for} = "Ne peut pas trouver d\'adresse IP pour \${EscapeHTML(\$host)}";
+
+$Lang{host_is_a_DHCP_host} = <<EOF;
+L\'hôte est un serveur DHCP, et je ne connais pas son adresse IP. J\'ai
+vérifié le nom netbios de \$ENV{REMOTE_ADDR}\$tryIP, et j\'ai trouvé que
+cette machine n\'est pas \$host.
+<p>
+Tant que je ne verrai pas \$host à une adresse DHCP particulière, vous
+ne pourrez démarrer cette requête que depuis la machine elle même.
+EOF
+
+
+# ------------------------------------
+# !! Server Mesg !!
+# ------------------------------------
+
+# Ne pas mélanger $reply et $str cf vers ligne: 248
+
+$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{log_Can_t_fork_for_tar_restore_request_by__User} = "log Ne peut pas se dupliquer (fork)"
+ . " pour la restauration tar demandée par \$User";
+$Lang{log_User__User_downloaded_tar_archive_for__host} = "log L\'utilisateur \$User a téléchargé "
+ . "l\'archive tar pour \$host,"
+ . " sauvegarde \$num; Les fichiers étaient: "
+ . " \${join(\", \", \@fileListTrim)}";
+$Lang{log_Can_t_fork_for_zip_restore_request_by__User} = "log Ne peut pas se dupliquer (fork)"
+ . "pour la restauration zip demandée par \$User";
+$Lang{log_User__User_downloaded_zip_archive_for__host}= "log L\'utilisateur \$User a téléchargé "
+ . "l\'archive zip pour \$host,"
+ . " Sauvegarde \$num; Les fichiers étaient: "
+ . "\${join(\", \", \@fileListTrim)}";
+$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{backup__In_hostIP___host} = "Sauvegarde \$In{hostIP} \$host"
+# . " \$User \$doFull";
+#
+#$Lang{backup__host__host__User__doFull} = "backup \$host \$host \$User \$doFull";
+#$Lang{restore__ipAddr} = "Restauration \$ipAddr"
+# . " \$hostDest \$User \$reqFileName";
+#$Lang{stop__host__User__In_backoff} = "Arrêt \$host \$User \$In{backoff}";
+
+
+# -------------------------------------------------
+# ------- Stuff that was forgotten ----------------
+# -------------------------------------------------
+
+$Lang{Status} = "Status";
+$Lang{PC_Summary} = "Bilan du PC";
+$Lang{LOG_file} = "Fichier de LOG";
+$Lang{Old_LOGs} = "Vieux LOGs";
+$Lang{Email_summary} = "Résumé des emails";
+$Lang{Config_file} = "Fichier de configuration";
+$Lang{Hosts_file} = "Fichiers des hôtes";
+$Lang{Current_queues} = "Files actuelles";
+$Lang{Documentation} = "Documentation";
+
+$Lang{Host_or_User_name} = "<small>Hôte ou Nom d\'utilisateur:</small>";
+$Lang{Go} = "Chercher";
+$Lang{Hosts} = "Hôtes";
+
+$Lang{This_PC_has_never_been_backed_up} = "<h2> Ce PC n'a jamais été sauvegardé !! </h2>\n";
+$Lang{This_PC_is_used_by} = "<li>Ce PC est utilisé par \${UserLink(\$user)}";
+
+# ------------
+$Lang{Last_email_sent_to__was_at___subject} = <<EOF;
+<li>Dernier email envoyé à \${UserLink(\$user)} le \$mailTime, avait comme sujet "\$subj".
+EOF
+# ------------
+$Lang{The_command_cmd_is_currently_running_for_started} = <<EOF;
+<li>La commande \$cmd s\'exécute actuellement sur \$host, démarrée le \$startTime.
+EOF
+
+# -----------
+$Lang{Host_host_is_queued_on_the_background_queue_will_be_backed_up_soon} = <<EOF;
+<li>L\'hôte \$host se trouve dans la liste d\'attente d\'arrière plan (sera sauvegardé bientôt).
+EOF
+
+# ----------
+$Lang{Host_host_is_queued_on_the_user_queue__will_be_backed_up_soon} = <<EOF;
+<li>L\'hôte \$host se trouve dans la liste d\'attente utilisateur (sera sauvegardé bientôt).
+EOF
+
+# ---------
+$Lang{A_command_for_host_is_on_the_command_queue_will_run_soon} = <<EOF;
+<li>Une commande pour l\'hôte \$host est dans la liste d\'attente des commandes (sera lancé bientôt).
+EOF
+
+# --------
+$Lang{Last_status_is_state_StatusHost_state_reason_as_of_startTime} = <<EOF;
+<li>L\'état courant est \"\$StatusHost{state}\"\$reason <!-- FIXME -->
+ à compter du \$startTime.
+EOF
+
+# --------
+$Lang{Last_error_is____EscapeHTML_StatusHost_error} = <<EOF;
+<li>La dernière erreur est \"\${EscapeHTML(\$StatusHost{error})}\"
+EOF
+
+# ------
+$Lang{Pings_to_host_have_failed_StatusHost_deadCnt__consecutive_times} = <<EOF;
+<li>Les pings vers \$host ont échoués \$StatusHost{deadCnt} fois consécutives.
+EOF
+
+# -----
+$Lang{Prior_to_that__pings} = "Avant cela, pings";
+
+# -----
+$Lang{priorStr_to_host_have_succeeded_StatusHostaliveCnt_consecutive_times} = <<EOF;
+<li>Les \$priorStr vers \$host ont réussi \$StatusHost{aliveCnt} fois consécutives.
+EOF
+
+$Lang{Because__host_has_been_on_the_network_at_least__Conf_BlackoutGoodCnt_consecutive_times___} = <<EOF;
+<li>Du fait que \$host a été présent sur le réseau au moins \$Conf{BlackoutGoodCnt}
+fois consécutives, il ne sera pas sauvegardé de \$t0 à \$t1 pendant \$days.
+EOF
+
+$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>).
+EOF
+
+$Lang{info_jobs_hosts_queueLen} = "info tâches hôtes queueLen"; # FIXME
+
+$Lang{tryIP} = " et \$StatusHost{dhcpHostIP}";
+
+$Lang{Host_Inhost} = "Hôte \$In{host}";
+
+$Lang{checkAll} = <<EOF;
+<tr bgcolor="#ffffcc"><td>
+<input type="checkbox" name="allFiles" onClick="return checkAll('allFiles');"> Tout sélectionner
+</td><td colspan="4" align="center">
+<input type="submit" name="Submit" value="Restaure les fichiers sélectionnés">
+</td></tr>
+EOF
+
+$Lang{fileHeader} = <<EOF;
+ <tr bgcolor="\$Conf{CgiHeaderBgColor}"><td align=center> Nom</td>
+ <td align="center"> Type</td>
+ <td align="center"> Mode</td>
+ <td align="center"> Taille</td>
+ <td align="center"> Date modification</td>
+ </tr>
+EOF
+
+$Lang{Home} = "Accueil";
+$Lang{Last_bad_XferLOG} = "Dernier bilan transmissions échouées";
+$Lang{Last_bad_XferLOG_errors_only} = "Dernier bilan transmissions échouées (erreurs seulement)";
+
+$Lang{This_display_is_merged_with_backup} = <<EOF;
+<li> Cet affichage est regroupé avec la sauvegarde n°\$numF, la plus récente copie intégrale.
+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 border>
+<tr><td align="center"> Sauvegarde n° </td>
+ <td align="center"> Résultat </td>
+ <td align="right"> Date de départ</td>
+ <td align="right"> Durée/mins</td>
+ <td align="right"> Nb fichiers </td>
+ <td align="right"> Mo </td>
+ <td align="right"> Nb errs tar </td>
+ <td align="right"> Nb errs trans </td>
+</tr>
+\$restoreStr
+</table>
+<p>
+EOF
+
+$Lang{BackupPC__Documentation} = "BackupPC: Documentation";
+
+$Lang{No} = "non";
+$Lang{Yes} = "oui";
+
+$Lang{The_directory_is_empty} = <<EOF;
+<tr><td bgcolor="#ffffff">Le repertoire \${EscapeHTML(\$dirDisplay)} est vide
+</td></tr>
+EOF
+
+$Lang{on} = "actif";
+$Lang{off} = "inactif";
+
+$Lang{full} = "complet";
+$Lang{incremental} = "incrémental";
+
+$Lang{failed} = "échec";
+$Lang{success} = "succès";
+$Lang{and} = "et";
+
+#end of lang_fr.pm
use strict;
-use vars qw(%Conf);
+use vars qw(%Conf %Lang);
use Fcntl qw/:flock/;
use Carp;
use DirHandle ();
my $class = shift;
my($topDir) = @_;
my $self = bless {
- TopDir => $topDir || '__TOPDIR__',
- BinDir => '__INSTALLDIR__/bin',
+ TopDir => $topDir || '/data/BackupPC',
+ BinDir => '/usr/local/BackupPC/bin',
+ LibDir => '/usr/local/BackupPC/lib',
Version => '1.5.0',
BackupFields => [qw(
num type startTime endTime
return %{$self->{Conf}};
}
+sub Lang
+{
+ my($self) = @_;
+ return $self->{Lang};
+}
+
sub adminJob
{
return " admin ";
}
%{$self->{Conf}} = ( %{$self->{Conf} || {}}, %Conf );
}
+ my $langFile = "$self->{LibDir}/BackupPC/Lang/$self->{Conf}{Language}.pm";
+ if ( !defined($ret = do $langFile) && ($! || $@) ) {
+ $mesg = "Couldn't open language file $langFile: $!" if ( $! );
+ $mesg = "Couldn't execute language file $langFile: $@" if ( $@ );
+ $mesg =~ s/[\n\r]+//;
+ return $mesg;
+ }
+ $self->{Lang} = \%Lang;
return;
}
if ( !open(HOST_INFO, "$self->{TopDir}/conf/hosts") ) {
print(STDERR $self->timeStamp,
"Can't open $self->{TopDir}/conf/hosts\n");
- return;
+ return {};
}
while ( <HOST_INFO> ) {
s/[\n\r]+//;
s/#.*//;
+ s/\s+$//;
next if ( /^\s*$/ || !/^([\w\.-]+\s+.*)/ );
@fld = split(/\s+/, $1);
if ( @hdr ) {
if ( defined($host) ) {
next if ( lc($fld[0]) ne $host );
@{$hosts{lc($fld[0])}}{@hdr} = @fld;
+ close(HOST_INFO);
return \%hosts;
} else {
@{$hosts{lc($fld[0])}}{@hdr} = @fld;
lib/BackupPC/Attrib.pm
lib/BackupPC/FileZIO.pm
lib/BackupPC/Lib.pm
+ lib/BackupPC/Lang/en.pm
+ lib/BackupPC/Lang/fr.pm
lib/BackupPC/PoolWrite.pm
lib/BackupPC/Xfer/Smb.pm
lib/BackupPC/Xfer/Tar.pm