From 1282f5f90cf092cb406ee186e6bf328875e4c306 Mon Sep 17 00:00:00 2001 From: cbarratt Date: Sun, 11 Aug 2002 05:00:55 +0000 Subject: [PATCH] * 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. --- CVS_README | 43 ++ ChangeLog | 19 +- cgi-bin/BackupPC_Admin | 1101 ++++++++++----------------------------- configure.pl | 6 +- doc-src/BackupPC.pod | 857 +----------------------------- lib/BackupPC/Lang/en.pm | 906 ++++++++++++++++++++++++++++++++ lib/BackupPC/Lang/fr.pm | 932 +++++++++++++++++++++++++++++++++ lib/BackupPC/Lib.pm | 25 +- makeDist | 2 + 9 files changed, 2207 insertions(+), 1684 deletions(-) create mode 100644 CVS_README create mode 100644 lib/BackupPC/Lang/en.pm create mode 100644 lib/BackupPC/Lang/fr.pm diff --git a/CVS_README b/CVS_README new file mode 100644 index 0000000..8a061d4 --- /dev/null +++ b/CVS_README @@ -0,0 +1,43 @@ +#======================================================================== +# +# CVS_README - CVS README file for BackupPC. +# +# DESCRIPTION +# Instructions for using CVS +# +# AUTHOR +# Craig Barratt +# +#======================================================================== +# +# 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. diff --git a/ChangeLog b/ChangeLog index 4c3e959..e5e0dbd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -11,12 +11,29 @@ # #======================================================================== # -# 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 #------------------------------------------------------------------------ diff --git a/cgi-bin/BackupPC_Admin b/cgi-bin/BackupPC_Admin index c0c2af0..ccdb618 100755 --- a/cgi-bin/BackupPC_Admin +++ b/cgi-bin/BackupPC_Admin @@ -1,4 +1,4 @@ -#!/bin/perl -T +#!/usr/bin/perl -T #============================================================= -*-perl-*-w # # BackupPC_Admin: Apache/CGI interface for BackupPC. @@ -38,7 +38,7 @@ # #======================================================================== # -# Version 1.5.0, released 2 Aug 2002. +# Version 1.5.0beta0, released 30 Jun 2002. # # See http://backuppc.sourceforge.net. # @@ -46,7 +46,7 @@ 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); @@ -58,6 +58,8 @@ use vars qw(%Status %Info %Jobs @BgQueue @UserQueue @CmdQueue use vars qw($Hosts $HostsMTime $ConfigMTime $PrivAdmin); use vars qw(%UserEmailInfo $UserEmailInfoMTime %RestoreReq); +use vars qw ($Lang); + $Cgi = new CGI; %In = $Cgi->Vars; @@ -71,16 +73,18 @@ $MyURL = $ENV{SCRIPT_NAME}; $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(); } # @@ -94,36 +98,41 @@ $ENV{PATH} = $Conf{MyPath}; # 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); @@ -142,7 +151,7 @@ sub Action_Summary 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); @@ -182,6 +191,7 @@ sub Action_Summary $fullTot += $fullCnt; $incrTot += $incrCnt; $fullSize = sprintf("%.2f", $fullSize / 1000); + if (! $incrAge) { $incrAge = " "; } $str = < ${HostLink($host)} ${UserLink($Hosts->{$host}{user})} @@ -206,119 +216,52 @@ EOF $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 < -This status was generated at $now. -

- -${h2("Hosts with good Backups")} -

-There are $hostCntGood hosts that have been backed up, for a total of: -

    -
  • $fullTot full backups of total size ${fullSizeTot}GB - (prior to pooling and compression), -
  • $incrTot incr backups of total size ${incrSizeTot}GB - (prior to pooling and compression). -
- - - - - - - - - - - -$strGood -
Host User #Full Full Age/days Full Size/GB Speed MB/sec #Incr Incr Age/days State Last attempt
-

- -${h2("Hosts with no Backups")} -

-There are $hostCntNone hosts with no backups. -

- - - - - - - - - - - -$strNone -
Host User #Full Full Age/days Full Size/GB Speed MB/sec #Incr Incr Age/days Current State Last backup attempt
-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 < -Reply from server was: $reply -

-Go back to $host home page. -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 < -You are about to start a $type backup on $host. - -

- - - -Do you really want to do this? - - -
-EOF + Header($Lang->{BackupPC__Start_Backup_Confirm_on__host}); + print (eval ("qq{$Lang->{Are_you_sure_start}}")); } else { my $backoff = ""; GetStatusInfo("host($host)"); @@ -326,23 +269,8 @@ EOF $backoff = sprintf("%.1f", ($StatusHost{backoffTime} - time) / 3600); } - Header("BackupPC: Stop Backup Confirm on $host"); - print < -You are about to stop/dequeue backups on $host; - -
- - -Also, please don't start another backup for - hours. -

-Do you really want to do this? - - -

-EOF + Header($Lang->{BackupPC__Stop_Backup_Confirm_on__host}); + print (eval ("qq{$Lang->{Are_you_sure_stop}}")); } Trailer(); } @@ -356,7 +284,7 @@ sub Action_Queue my $Privileged = CheckPermission(); if ( !$Privileged ) { - ErrorExit("Only privileged users can view queues." ); + ErrorExit($Lang->{Only_privileged_users_can_view_queues_}); } while ( @BgQueue ) { @@ -388,43 +316,10 @@ EOF $cmd EOF } - Header("BackupPC: Queue Summary"); - print < -${h2("User Queue Summary")} -

-The following user requests are currently queued: - - - - -$strUser -
Host Req Time User
-

- -${h2("Background Queue Summary")} -

-The following background requests are currently queued: - - - - -$strBg -
Host Req Time User
-

- -${h2("Command Queue Summary")} -

-The following command requests are currently queued: - - - - - -$strCmd -
Host Req Time User Command
-EOF + Header($Lang->{BackupPC__Queue_Summary}); + + print ( eval ( "qq{$Lang->{Backup_Queue_Summary}}") ); + Trailer(); } @@ -440,7 +335,7 @@ sub Action_View 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"); @@ -465,12 +360,12 @@ sub Action_View } elsif ( $type eq "docs" ) { $file = "$BinDir/../doc/BackupPC.html"; if ( open(LOG, $file) ) { - Header("BackupPC: Documentation"); + Header($Lang->{BackupPC__Documentation}); print while ( ); 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" ) { @@ -484,22 +379,19 @@ sub Action_View $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 + 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 <$file, modified $mtimeStr $comment -EOF + + print ( eval ("qq{$Lang->{Contents_of_log_file}}")); + print "

";
         if ( $type eq "XferErr" || $type eq "XferErrbad"
 				|| $type eq "RestoreErr" ) {
@@ -507,7 +399,7 @@ EOF
             while ( 1 ) {
                 $_ = $fh->readLine();
                 if ( $_ eq "" ) {
-		    print("[ skipped $skipped lines ]\n") if ( $skipped );
+		    print(eval ("qq{$Lang->{skipped__skipped_lines}}"));
 		    last;
 		}
                 if ( /smb: \\>/
@@ -529,7 +421,7 @@ EOF
 		    $skipped++;
 		    next;
 		}
-		print("[ skipped $skipped lines ]\n") if ( $skipped );
+		print(eval("qq{$Lang->{skipped__skipped_lines}}")) if ( $skipped );
 		$skipped = 0;
                 print ${EscapeHTML($_)};
             }
@@ -561,7 +453,7 @@ EOF
         }
         $fh->close();
     } else {
-        printf("
\nCan't open log file $file\n");
+	printf( eval("qq{$Lang->{_pre___Can_t_open_log_file__file}}"));
     }
     print <
@@ -574,7 +466,7 @@ sub Action_LOGlist
     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);
@@ -604,18 +496,8 @@ sub Action_LOGlist
      $mtimeStr 
 EOF
     }
-    Header("BackupPC: Log File History");
-    print <
-
-
-    
-    
-$str
-
File Size Modification time
-EOF + Header($Lang->{BackupPC__Log_File_History}); + print (eval("qq{$Lang->{Log_File_History__hdr}}")); Trailer(); } @@ -624,7 +506,7 @@ sub Action_EmailSummary 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(); @@ -642,18 +524,8 @@ EOF foreach my $t ( sort({$b <=> $a} keys(%EmailStr)) ) { $str .= $EmailStr{$t}; } - Header("BackupPC: Email Summary"); - print < - - - - - -$str -
Recipient Host Time Subject
-EOF + Header($Lang->{Email_Summary}); + print (eval("qq{$Lang->{Recent_Email_Summary}}")); Trailer(); } @@ -665,14 +537,13 @@ sub Action_Browse 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 @@ -700,8 +571,7 @@ sub Action_Browse $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 @@ -715,8 +585,7 @@ sub Action_Browse } 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; @@ -750,8 +619,7 @@ sub Action_Browse 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 @@ -898,12 +766,9 @@ EOF $dirDisplay =~ s{//}{/}g; my $filledBackup; if ( defined($numF) ) { - $filledBackup = < 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 .= "{tdArgs}>$d->{link}\n"; @@ -912,104 +777,20 @@ EOF ### hide checkall button if there are no files my ($topCheckAll, $checkAll, $fileHeader); if ( $fileStr ) { - $fileHeader = < Name - Type - Mode - Size - Mod time - -EOF - $checkAll = < - Select all - - - -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 = <The directory ${EscapeHTML($dirDisplay)} is empty - -EOF + $fileStr = eval("qq{$Lang->{The_directory_is_empty}}"); } - print < - - - -
    -
  • You are browsing backup #$num, which started around $backupTime - ($backupAge days ago), -$filledBackup -
  • Click on a directory below to navigate into that directory, -
  • Click on a file below to restore that file. -
- -${h2("Contents of ${EscapeHTML($dirDisplay)}")} -
- - - - -
- -
- -
- $dirStr -
-
- - -
-
- - $fileHeader - $topCheckAll - $fileStr - $checkAll -
-
-
- -
-
-EOF + print (eval("qq{$Lang->{Backup_browse_for__host}}")); Trailer(); } @@ -1018,8 +799,7 @@ sub Action_Restore 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}; @@ -1032,7 +812,7 @@ sub Action_Restore 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"}) ); @@ -1062,11 +842,10 @@ EOF $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/; @@ -1083,122 +862,19 @@ EOF # # Tell the user what options they have # - Header("BackupPC: Restore Options for $host"); - print < -You have selected the following files/directories from -share $share, backup number #$num: -
    -$fileListStr -
-

-You have three choices for restoring these files/directories. -Please select one of the following options. -

-${h2("Option 1: Direct Restore")} -

-You can start a restore that will restore these files directly onto -$host. -

-Warning: any existing files that match the ones you have -selected will be overwritten! - -

- - - -$hiddenStr - - - - - - - - - - - - - -
Restore the files to host
Restore the files to share
Restore the files below dir
(relative to share)
-
-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 < -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. -

-Warning: 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. -

-

- - - -$hiddenStr - - Make archive relative -to ${EscapeHTML($pathHdr eq "" ? "/" : $pathHdr)} -(otherwise archive will contain full paths). -
-Compression (0=off, 1=fast,...,9=best) - -
- -
-EOF + print (eval("qq{$Lang->{Option_2__Download_Zip_archive}}")); } else { - print < -You could download a zip archive, but Archive::Zip is not installed. -Please ask your system adminstrator to install Archive::Zip from -www.cpan.org. -

-EOF + print (eval("qq{$Lang->{Option_2__Download_Zip_archive2}}")); } - print < -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. -

-Warning: 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. -

-

- - - -$hiddenStr - - Make archive relative -to ${EscapeHTML($pathHdr eq "" ? "/" : $pathHdr)} -(otherwise archive will contain full paths). -
- -
-EOF + print (eval("qq{$Lang->{Option_3__Download_Zip_archive}}")); Trailer(); } elsif ( $In{type} == 1 ) { # @@ -1207,8 +883,8 @@ EOF $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 ) { # @@ -1218,9 +894,7 @@ EOF 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; } # @@ -1248,8 +922,8 @@ EOF $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 ) { # @@ -1259,9 +933,7 @@ EOF 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; } # @@ -1289,11 +961,10 @@ EOF # 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 ) { @@ -1305,40 +976,15 @@ EOF $host:/$strippedShare$f$In{hostDest}:/$strippedShareDest$targetFile EOF } - Header("BackupPC: Restore Confirm on $host"); - print < -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: -

- - -$fileListStr -
Original file/dirWill be restored to
- -

- - - - - - -$hiddenStr -Do you really want to do this? - - -
-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); @@ -1380,21 +1026,12 @@ EOF 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 < -Reply from server was: $reply -

-Go back to $hostDest home page. -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(); } } @@ -1497,13 +1134,12 @@ sub restoreFile }; 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++ ) { @@ -1537,7 +1173,7 @@ sub restoreFile } } 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}); @@ -1607,7 +1243,7 @@ sub Action_HostInfo } } CheckPermission(); - ErrorExit("Unknown host or user ${EscapeHTML($host)}") + ErrorExit(eval("qq{$Lang->{Unknown_host_or_user}}")) if ( !defined($Hosts->{$host}) ); } $In{host} = $host; @@ -1617,8 +1253,7 @@ sub Action_HostInfo %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(); @@ -1648,12 +1283,15 @@ sub Action_HostInfo } 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 .= < $Backups[$i]{num} - $Backups[$i]{type} + $ltype $filled $startTime $duration @@ -1662,7 +1300,7 @@ sub Action_HostInfo EOF $sizeStr .= < $Backups[$i]{num} - $Backups[$i]{type} + $ltype $Backups[$i]{nFiles} $MB $MBperSec @@ -1673,13 +1311,17 @@ EOF 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 .= < $Backups[$i]{num} - $Backups[$i]{type} - $Backups[$i]{compress} + $ltype + $is_compress $MBExist - $MBExistComp - $ExistComp + $MBExistComp + $ExistComp $MBNew $MBNewComp $NewComp @@ -1687,7 +1329,7 @@ EOF EOF $errStr .= < $Backups[$i]{num} - $Backups[$i]{type} + $ltype XferLOG, Errors $Backups[$i]{xferErrs} @@ -1707,9 +1349,11 @@ EOF 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 .= <$Restores[$i]{num} - $Restores[$i]{result} + $Restores_Result $startTime $duration $Restores[$i]{nFiles} @@ -1719,65 +1363,48 @@ EOF EOF } - $restoreStr = < -Click on the restore number for more details. - - - - - - - - - - -$restoreStr -
Restore# Result Start Date Dur/mins #files MB #tar errs #xferErrs
-

-EOF - + if ( $restoreStr ne "" ) { + $restoreStr = eval("qq{$Lang->{Restore_Summary}}"); + } if ( @Backups == 0 ) { - $warnStr = "

This PC has never been backed up!!

\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 .= <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 .= <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 .= <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 .= <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 .= <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 .= <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}); @@ -1785,27 +1412,19 @@ EOF if ( $StatusHost{reason} ne "" ) { $reason = " ($StatusHost{reason})"; } - $statusStr .= <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 .= <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 .= <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 .= <$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 ) { @@ -1817,133 +1436,31 @@ EOF my($t1) = sprintf("%d:%02d", $Conf{BlackoutHourEnd}, 60 * ($Conf{BlackoutHourEnd} - int($Conf{BlackoutHourEnd}))); - $statusStr .= <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 .= <Backups are deferred for $hours hours - (change this - number). -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 } - Header("BackupPC: Host $host Backup Summary"); - print < -$warnStr -
    -$statusStr -
+ $startIncrStr = eval ("qq{$startIncrStr}"); -${h2("User Actions")} -

-

- -$startIncrStr - - -
- -${h2("Backup Summary")} -

-Click on the backup number to browse and restore backup files. - - - - - - - - - -$str -
Backup# Type Filled Start Date Duration/mins Age/days Server Backup Path
-

- -$restoreStr - -${h2("Xfer Error Summary")} -

- - - - - - - - - -$errStr -
Backup# Type View #Xfer errs #bad files #bad share #tar errs
-

- -${h2("File Size/Count Reuse Summary")} -

-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. - - - - - - - - - - - - - - - - - -$sizeStr -
Totals Existing Files New Files
Backup# Type #Files Size/MB MB/sec #Files Size/MB #Files Size/MB
-

- -${h2("Compression Summary")} -

-Compression performance for files already in the pool and newly -compressed files. - - - - - - - - - - - - - - - -$compStr -
Existing Files New Files
Backup# Type Comp Level Size/MB Comp/MB Comp Size/MB Comp/MB Comp
-

-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); @@ -2023,59 +1540,15 @@ EOF } elsif ( $Info{cpoolFileCnt} > 0 ) { $poolInfo = $cpoolInfo; } - Header("BackupPC: Server Status"); - print < + 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}); -

    -
  • The server's PID is $Info{pid} on host $Conf{ServerHost}, - version $Info{Version}, started at $serverStartTime. -
  • This status was generated at $now. -
  • PCs will be next queued at $nextWakeupTime. -
  • Other info: -
      -
    • $numBgQueue pending backup requests from last scheduled wakeup, -
    • $numUserQueue pending user backup requests, -
    • $numCmdQueue pending command requests, - $poolInfo -
    • Pool file system was recently at $Info{DUlastValue}% - ($DUlastTime), today's max is $Info{DUDailyMax}% ($DUmaxTime) - and yesterday's max was $Info{DUDailyMaxPrev}%. -
    -
- -${h2("Currently Running Jobs")} -

- - - - - - - - - $tarPidHdr -$jobStr -
Host Type User Start Time Command PID Xfer PID
-

- -${h2("Failures that need attention")} -

- - - - - - - - -$statusStr -
Host Type User Last Try Details Error Time Last error (other than no ping)
-EOF + #my $trans_text = $Lang->{BackupPC_Server_Status}; + #print eval ("qq{$trans_text}"); Trailer(); } @@ -2087,7 +1560,7 @@ sub Action_RestoreInfo 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 @@ -2097,8 +1570,7 @@ sub Action_RestoreInfo 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 = (); @@ -2125,41 +1597,8 @@ sub Action_RestoreInfo EOF } - Header("BackupPC: Restore #$num details for $host"); - print < - - - - - - - - - - - - - - - - - - - -
Number $Restores[$i]{num}
Requested by $RestoreReq{user}
Request time $reqTime
Result $Restores[$i]{result}
Error Message $Restores[$i]{errorMsg}
Source host $RestoreReq{hostSrc}
Source backup num $RestoreReq{num}
Source share $RestoreReq{shareSrc}
Destination host $RestoreReq{hostDest}
Destination share $RestoreReq{shareDest}
Start time $startTime
Duration $duration min
Number of files $Restores[$i]{nFiles}
Total size ${MB} MB
Transfer rate $MBperSec MB/sec
TarCreate errors $Restores[$i]{tarCreateErrs}
Xfer errors $Restores[$i]{xferErrs}
Xfer log file -View, -Errors -
-

-${h1("File/Directory list")} -

- - -$fileListStr -
Original file/dirRestored to
-EOF + Header(eval("qq{$Lang->{Restore___num_details_for__host}}")); + print(eval("qq{$Lang->{Restore___num_details_for__host2 }}")); Trailer(); } @@ -2217,7 +1656,7 @@ sub EscapeHTML $s =~ s/\"/"/g; $s =~ s/>/>/g; $s =~ s/ServerMesg("log User $User (host=$In{host}) got CGI error: $head") if ( defined($bpc) ); - Header("BackupPC: Error"); - print <{Error}) ) { + Header("BackupPC: Error"); + print <$mesg

EOF - Trailer(); + Trailer(); + } else { + Header(eval("qq{$Lang->{Error}}")); + print (eval("qq{$Lang->{Error____head}}")); + Trailer(); + } exit(1); } @@ -2257,14 +1702,7 @@ sub ServerConnect 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}}")); } } @@ -2314,9 +1752,28 @@ sub CheckPermission } $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 @@ -2338,20 +1795,13 @@ sub ConfirmIPAddress 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)}", - < -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}; } @@ -2366,14 +1816,8 @@ sub genPoolInfo my $poolRmSize = sprintf("%.2f", $info->{"${name}KbRm"} / (1000 * 1024)); my $poolTime = timeStamp2($info->{"${name}Time"}); $info->{"${name}FileCntRm"} = $info->{"${name}FileCntRm"} + 0; - return <Pool is ${poolSize}GB comprising $info->{"${name}FileCnt"} files - and $info->{"${name}DirCnt"} directories (as of $poolTime), -
  • Pool hashing gives $info->{"${name}FileCntRep"} repeated - files with longest chain $info->{"${name}FileRepMax"}, -
  • Nightly cleanup removed $info->{"${name}FileCntRm"} files of - size ${poolRmSize}GB (around $poolTime), -EOF + return eval("qq{$Lang->{Pool_Stat}}"); + } ########################################################################### @@ -2384,16 +1828,16 @@ sub Header { 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}, @@ -2412,44 +1856,43 @@ EOF 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 < - Host or User name: + $Lang->{Host_or_User_name}
    - +
    EOF - NavSectionTitle("Server"); + NavSectionTitle($Lang->{NavSectionTitle_}); NavSectionStart(); foreach my $l ( @adminLinks ) { if ( $PrivAdmin || $l->{priv} ) { @@ -2473,31 +1916,6 @@ sub Trailer EOF } -sub h1 -{ - my($str) = @_; - return \< - - $str - - -EOF -} - -sub h2 -{ - my($str) = @_; - return \< - - $str - - -EOF -} sub NavSectionTitle { @@ -2513,8 +1931,11 @@ EOF sub NavSectionStart { + my($padding) = @_; + + $padding = 2 if ( !defined($padding) ); print < + EOF } @@ -2538,3 +1959,29 @@ EOF EOF } } + +sub h1 +{ + my($str) = @_; + return \< + + +
     $str +
    +EOF +} + +sub h2 +{ + my($str) = @_; + return \< + + $str + + +EOF +} diff --git a/configure.pl b/configure.pl index c78e7a3..d4ec871 100755 --- a/configure.pl +++ b/configure.pl @@ -33,7 +33,7 @@ # #======================================================================== # -# Version 1.5.0, released 2 Aug 2002. +# Version __VERSION__, released __RELEASEDATE__. # # See http://backuppc.sourceforge.net. # @@ -409,7 +409,9 @@ unlink("$Conf{InstallDir}/bin/BackupPC_queueAll"); 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); } diff --git a/doc-src/BackupPC.pod b/doc-src/BackupPC.pod index 248d761..8958782 100644 --- a/doc-src/BackupPC.pod +++ b/doc-src/BackupPC.pod @@ -1,7 +1,7 @@ =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 @@ -417,10 +417,10 @@ To build and install these packages you should run these commands: 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 @@ -960,6 +960,7 @@ to Apache's httpd.conf file: PerlModule Apache::Registry + PerlTaintCheck On # <--- change path as needed SetHandler perl-script PerlHandler Apache::Registry @@ -2469,851 +2470,7 @@ settings for the CGI interface. 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} = ''; - -Additional CGI header text. For example, if you wanted each CGI page -to auto refresh every 900 seconds, you could add this text: - - - -=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 diff --git a/lib/BackupPC/Lang/en.pm b/lib/BackupPC/Lang/en.pm new file mode 100644 index 0000000..065a888 --- /dev/null +++ b/lib/BackupPC/Lang/en.pm @@ -0,0 +1,906 @@ +#!/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}= < +\${h2(\"General Server Information\")} + +
      +
    • The servers PID is \$Info{pid}, on host \$Conf{ServerHost}, + version \$Info{Version}, started at \$serverStartTime. +
    • This status was generated at \$now. +
    • PCs will be next queued at \$nextWakeupTime. +
    • Other info: +
        +
      • \$numBgQueue pending backup requests from last scheduled wakeup, +
      • \$numUserQueue pending user backup requests, +
      • \$numCmdQueue pending command requests, + \$poolInfo +
      • Pool file system was recently at \$Info{DUlastValue}% + (\$DUlastTime), today\'s max is \$Info{DUDailyMax}% (\$DUmaxTime) + and yesterday\'s max was \$Info{DUDailyMaxPrev}%. +
      +
    + +\${h2("Currently Running Jobs")} +

    + + + + + + + + + \$tarPidHdr +\$jobStr +
    Host Type User Start Time Command PID Xfer PID
    +

    + +\${h2("Failures that need attention")} +

    + + + + + + + + +\$statusStr +
    Host Type User Last Try Details Error Time Last error (other than no ping)
    +EOF + +# -------------------------------- +$Lang{BackupPC__Server_Summary} = "BackupPC: Server Summary"; +$Lang{BackupPC_Summary}=< +This status was generated at \$now. +

    + +\${h2("Hosts with good Backups")} +

    +There are \$hostCntGood hosts that have been backed up, for a total of: +

      +
    • \$fullTot full backups of total size \${fullSizeTot}GB + (prior to pooling and compression), +
    • \$incrTot incr backups of total size \${incrSizeTot}GB + (prior to pooling and compression). +
    + + + + + + + + + + + +\$strGood +
    Host User #Full Full Age/days Full Size/GB Speed MB/sec #Incr Incr Age/days State Last attempt
    +

    + +\${h2("Hosts with no Backups")} +

    +There are \$hostCntNone hosts with no backups. +

    + + + + + + + + + + + +\$strNone +
    Host User #Full Full Age/days Full Size/GB Speed MB/sec #Incr Incr Age/days Current State Last backup attempt
    +EOF + +# ----------------------------------- +$Lang{Pool_Stat} = <Pool is \${poolSize}GB comprising \$info->{"\${name}FileCnt"} files + and \$info->{"\${name}DirCnt"} directories (as of \$poolTime), +

  • Pool hashing gives \$info->{"\${name}FileCntRep"} repeated + files with longest chain \$info->{"\${name}FileRepMax"}, +
  • 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} = < +Reply from server was: \$reply +

    +Go back to \$host home page. +EOF +# -------------------------------- +$Lang{BackupPC__Start_Backup_Confirm_on__host} = "BackupPC: Start Backup Confirm on \$host"; +# -------------------------------- +$Lang{Are_you_sure_start} = < +You are about to start a \$type backup on \$host. + +

    + + + +Do you really want to do this? + + +
    +EOF +# -------------------------------- +$Lang{BackupPC__Stop_Backup_Confirm_on__host} = "BackupPC: Stop Backup Confirm on \$host"; +# -------------------------------- +$Lang{Are_you_sure_stop} = < +You are about to stop/dequeue backups on \$host; + +
    + + +Also, please don\'t start another backup for + hours. +

    +Do you really want to do this? + + +

    + +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} = < +\${h2("User Queue Summary")} +

    +The following user requests are currently queued: + + + + +\$strUser +
    Host Req Time User
    +

    + +\${h2("Background Queue Summary")} +

    +The following background requests are currently queued: + + + + +\$strBg +
    Host Req Time User
    +

    + +\${h2("Command Queue Summary")} +

    +The following command requests are currently queued: + + + + + +\$strCmd +
    Host Req Time User Command
    +EOF + +# -------------------------------- +$Lang{Backup_PC__Log_File__file} = "BackupPC: Log File \$file"; +$Lang{Log_File__file__comment} = < +EOF +# -------------------------------- +$Lang{Contents_of_log_file} = <\$file, modified \$mtimeStr \$comment +EOF + +# -------------------------------- +$Lang{skipped__skipped_lines} = "[ skipped \$skipped lines ]\n"; +# -------------------------------- +$Lang{_pre___Can_t_open_log_file__file} = "

    \nCan\'t open log file \$file\n";
    +
    +# --------------------------------
    +$Lang{BackupPC__Log_File_History} = "BackupPC: Log File History";
    +$Lang{Log_File_History__hdr} = <
    +
    +
    +    
    +    
    +\$str
    +
    File Size Modification time
    +EOF + +# ------------------------------- +$Lang{Recent_Email_Summary} = < + + + + + +\$str +
    Recipient Host Time Subject
    +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} = < +You have selected the following files/directories from +share \$share, backup number #\$num: +
      +\$fileListStr +
    +

    +You have three choices for restoring these files/directories. +Please select one of the following options. +

    +\${h2("Option 1: Direct Restore")} +

    +You can start a restore that will restore these files directly onto +\$host. +

    +Warning: any existing files that match the ones you have +selected will be overwritten! + +

    + + + +\$hiddenStr + + + + + + + + + + + + + +
    Restore the files to host
    Restore the files to share
    Restore the files below dir
    (relative to share)
    +
    +EOF + +# ------------------------------ +$Lang{Option_2__Download_Zip_archive} = < +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. +

    +Warning: 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. +

    +

    + + + +\$hiddenStr + + Make archive relative +to \${EscapeHTML(\$pathHdr eq "" ? "/" : \$pathHdr)} +(otherwise archive will contain full paths). +
    +Compression (0=off, 1=fast,...,9=best) + +
    + +
    +EOF + +# ------------------------------ + +$Lang{Option_2__Download_Zip_archive2} = < +You could download a zip archive, but Archive::Zip is not installed. +Please ask your system adminstrator to install Archive::Zip from +www.cpan.org. +

    +EOF + + +# ------------------------------ +$Lang{Option_3__Download_Zip_archive} = < +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. +

    +Warning: 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. +

    +

    + + + +\$hiddenStr + + Make archive relative +to \${EscapeHTML(\$pathHdr eq "" ? "/" : \$pathHdr)} +(otherwise archive will contain full paths). +
    + +
    +EOF + + +# ------------------------------ +$Lang{Restore_Confirm_on__host} = "BackupPC: Restore Confirm on \$host"; + +$Lang{Are_you_sure} = < +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: +

    + + +\$fileListStr +
    Original file/dirWill be restored to
    + +

    + + + + + + +\$hiddenStr +Do you really want to do this? + + +
    +EOF + + +# -------------------------- +$Lang{Restore_Requested_on__hostDest} = "BackupPC: Restore Requested on \$hostDest"; +$Lang{Reply_from_server_was___reply} = < +Reply from server was: \$reply +

    +Go back to \$hostDest home page. +EOF + +# ------------------------- +$Lang{Host__host_Backup_Summary} = "BackupPC: Host \$host Backup Summary"; + +$Lang{Host__host_Backup_Summary2} = < +\$warnStr +

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

    +

    + +\$startIncrStr + + +
    + +\${h2("Backup Summary")} +

    +Click on the backup number to browse and restore backup files. + + + + + + + + + +\$str +
    Backup# Type Filled Start Date Duration/mins Age/days Server Backup Path
    +

    + +\$restoreStr + +\${h2("Xfer Error Summary")} +

    + + + + + + + + + +\$errStr +
    Backup# Type View #Xfer errs #bad files #bad share #tar errs
    +

    + +\${h2("File Size/Count Reuse Summary")} +

    +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. + + + + + + + + + + + + + + + + + +\$sizeStr +
    Totals Existing Files New Files
    Backup# Type #Files Size/MB MB/sec #Files Size/MB #Files Size/MB
    +

    + +\${h2("Compression Summary")} +

    +Compression performance for files already in the pool and newly +compressed files. + + + + + + + + + + + + + + + +\$compStr +
    Existing Files New Files
    Backup# Type Comp Level Size/MB Comp/MB Comp Size/MB Comp/MB Comp
    +

    +EOF + +# ------------------------- +$Lang{Error} = "BackupPC: Error"; +$Lang{Error____head} = <\$mesg

    +EOF + +# ------------------------- +$Lang{NavSectionTitle_} = "Server"; + +# ------------------------- +$Lang{Backup_browse_for__host} = < + + + +
      +
    • You are browsing backup #\$num, which started around \$backupTime + (\$backupAge days ago), +\$filledBackup +
    • Click on a directory below to navigate into that directory, +
    • Click on a file below to restore that file. +
    + +\${h2("Contents of \${EscapeHTML(\$dirDisplay)}")} +
    + + + + +
    + +
    + +
    + \$dirStr +
    +
    + + +
    +
    + + \$fileHeader + \$topCheckAll + \$fileStr + \$checkAll +
    +
    +
    + +
    +
    +EOF + +# ------------------------------ +$Lang{Restore___num_details_for__host} = "BackupPC: Restore #\$num details for \$host"; + +$Lang{Restore___num_details_for__host2 } = < + + + + + + + + + + + + + + + + + + + +
    Number \$Restores[\$i]{num}
    Requested by \$RestoreReq{user}
    Request time \$reqTime
    Result \$Restores[\$i]{result}
    Error Message \$Restores[\$i]{errorMsg}
    Source host \$RestoreReq{hostSrc}
    Source backup num \$RestoreReq{num}
    Source share \$RestoreReq{shareSrc}
    Destination host \$RestoreReq{hostDest}
    Destination share \$RestoreReq{shareDest}
    Start time \$startTime
    Duration \$duration min
    Number of files \$Restores[\$i]{nFiles}
    Total size \${MB} MB
    Transfer rate \$MBperSec MB/sec
    TarCreate errors \$Restores[\$i]{tarCreateErrs}
    Xfer errors \$Restores[\$i]{xferErrs}
    Xfer log file +View, +Errors +
    +

    +\${h1("File/Directory list")} +

    + + +\$fileListStr +
    Original file/dirRestored to
    +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} = < +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} = "Host or User name:"; +$Lang{Go} = "Go"; +$Lang{Hosts} = "Hosts"; + +$Lang{This_PC_has_never_been_backed_up} = "

    This PC has never been backed up!!

    \n"; +$Lang{This_PC_is_used_by} = "
  • This PC is used by \${UserLink(\$user)}"; + +# ------------ +$Lang{Last_email_sent_to__was_at___subject} = <Last email sent to \${UserLink(\$user)} was at \$mailTime, subject "\$subj". +EOF +# ------------ +$Lang{The_command_cmd_is_currently_running_for_started} = <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} = <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} = <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} = <A command for \$host is on the command queue (will run soon). +EOF + +# -------- +$Lang{Last_status_is_state_StatusHost_state_reason_as_of_startTime} = <Last status is state \"\$StatusHost{state}\"\$reason + as of \$startTime. +EOF + +# -------- +$Lang{Last_error_is____EscapeHTML_StatusHost_error} = <Last error is \"\${EscapeHTML(\$StatusHost{error})}\" +EOF + +# ------ +$Lang{Pings_to_host_have_failed_StatusHost_deadCnt__consecutive_times} = <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} = <\$priorStr to \$host have succeeded \$StatusHost{aliveCnt} + consecutive times. +EOF + +$Lang{Because__host_has_been_on_the_network_at_least__Conf_BlackoutGoodCnt_consecutive_times___} = <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} = <Backups are deferred for \$hours hours +(change this number). +EOF + +$Lang{info_jobs_hosts_queueLen} = "info jobs hosts queueLen"; + +$Lang{tryIP} = " and \$StatusHost{dhcpHostIP}"; + +$Lang{Host_Inhost} = "Host \$In{host}"; + +$Lang{checkAll} = < + Select all + + + +EOF + +$Lang{fileHeader} = < Name + Type + Mode + Size + Mod time + +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} = < This display is merged with backup #\$numF, the most recent prior + filled (full) dump. +EOF + +$Lang{Restore_Summary} = < +Click on the restore number for more details. + + + + + + + + + + +\$restoreStr +
    Restore# Result Start Date Dur/mins #files MB #tar errs #xferErrs
    +

    +EOF + +$Lang{BackupPC__Documentation} = "BackupPC: Documentation"; + +$Lang{No} = "no"; +$Lang{Yes} = "yes"; + +$Lang{The_directory_is_empty} = <The directory \${EscapeHTML(\$dirDisplay)} is empty + +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 diff --git a/lib/BackupPC/Lang/fr.pm b/lib/BackupPC/Lang/fr.pm new file mode 100644 index 0000000..e0afdda --- /dev/null +++ b/lib/BackupPC/Lang/fr.pm @@ -0,0 +1,932 @@ +#!/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}= < +\${h2(\"Informations Générales du serveur\")} + +

      +
    • Le PID du serveur est \$Info{pid}, sur l\'hôte \$Conf{ServerHost}, + version \$Info{Version}, démarré le \$serverStartTime. +
    • Ce rapport à été généré le \$now. +
    • La prochaine file d\'attente sera remplie le \$nextWakeupTime. +
    • Autres info: +
        +
      • \$numBgQueue demandes de sauvegardes en attente depuis le dernier réveil automatique, +
      • \$numUserQueue requêtes de sauvegardes utilisateur en attente, +
      • \$numCmdQueue requêtes de commandes en attente, + \$poolInfo +
      • 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}%. +
      +
    + +\${h2("Travaux en cours d'exécution")} +

    + + + + + + + + + \$tarPidHdr +\$jobStr +
    Hôte Type Utilisateur Date de départ Commande PID Xfer PID
    +

    + +\${h2("Échecs qui demandent de l'attention")} +

    + + + + + + + + +\$statusStr +
    Hôte Type Utilisateur Dernier essai Détails Date d\'erreur Dernière erreur (autre que pas de ping)
    +EOF + +# -------------------------------- +$Lang{BackupPC__Server_Summary} = "BackupPC: Résumé du serveur"; +$Lang{BackupPC_Summary}=< +Ce statut a été généré le \$now. +

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

    +Il y a \$hostCntGood hôtes ayant été sauvegardés, avec un total de : +

      +
    • \$fullTot sauvegardes complètes de tailles cumulées \${fullSizeTot} Go + (précédant le hachage et la compression), +
    • \$incrTot sauvegardes incrémentales de tailles cumulées \${incrSizeTot} Go + (précédant le hachage et la compression). +
    + + + + + + + + + + + +\$strGood +
    Hôte Utilisateur nb complètes complètes Âge/Jours complètes Taille/Go Vitesse Mo/sec nb incrémentales Incr Age/Jours État actuel Dernière tentative
    +

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

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

    + + + + + + + + + + + +\$strNone +
    Hôte Utilisateur Nb complètes Complètes Age/jour Complètes Taille/Go Vitesse Mo/sec Nb incrémentales Incrémentales Age/jours État actuel Dernière tentative
    +EOF + +# ----------------------------------- +$Lang{Pool_Stat} = <Le disque dispose de \${poolSize} Go avec \$info->{"\${name}FileCnt"} fichiers + et \$info->{"\${name}DirCnt"} repertoires (depuis le \$poolTime), +

  • Le hachage des fichiers donne \$info->{"\${name}FileCntRep"} fichiers répétés + avec comme plus longue chaîne \$info->{"\${name}FileRepMax"}, +
  • 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} = < +La réponse du serveur a été: \$reply +

    +Retourner à la page d\'accueil de \$host. +EOF +# -------------------------------- +$Lang{BackupPC__Start_Backup_Confirm_on__host} = "BackupPC: Confirmation du départ de la sauvegarde de \$host"; +# -------------------------------- +$Lang{Are_you_sure_start} = < +Vous allez bientôt démarrer une sauvegarde \$type depuis \$host. + +

    + + + +Voulez vous vraiment le faire ? + + +
    +EOF +# -------------------------------- +$Lang{BackupPC__Stop_Backup_Confirm_on__host} = "BackupPC: Confirmer l\'arrêt de la sauvegarde sur \$host"; +# -------------------------------- +$Lang{Are_you_sure_stop} = < +Vous êtes sur le point d\'arrêter/supprimer de la file les sauvegardes de \$host; + +
    + + +En outre, prière de ne pas démarrer d\'autres sauvegarde avant + heures. +

    +Voulez vous vraiment le faire ? + + +

    + +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} = < +\${h2("Résumé des files des utilisateurs")} +

    +Les demandes utilisateurs suivantes sont actuellement en attente : + + + + +\$strUser +
    Hôte Temps Requis Utilisateur
    +

    + +\${h2("Résumé de la file en arrière plan")} +

    +Les demandes en arrière plan suivantes sont actuellement en attente : + + + + +\$strBg +
    Hôte Temps requis Utilisateur
    +

    + +\${h2("Résumé de la file d\'attente des commandes")} +

    +Les demandes de commande suivantes sont actuellement en attente : + + + + + +\$strCmd +
    Hôtes Temps Requis Utilisateur Commande
    +EOF +# -------------------------------- +$Lang{Backup_PC__Log_File__file} = "BackupPC: Fichier de log \$file"; +$Lang{Log_File__file__comment} = < +EOF +# -------------------------------- +$Lang{Contents_of_log_file} = <\$file, modifié le \$mtimeStr \$comment +EOF + +# -------------------------------- +$Lang{skipped__skipped_lines} = "[ \$skipped lignes sautées ]\n"; +# -------------------------------- +$Lang{_pre___Can_t_open_log_file__file} = "

    \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} = <
    +
    +
    +    
    +    
    +\$str
    +
    Fichier Taille Date de modification
    +EOF + +# ------------------------------- +$Lang{Recent_Email_Summary} = < + + + + + +\$str +
    Recipient Hôte Date Sujet
    +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} = < +Vous avez sélectionné les fichiers/repertoires suivants depuis le partage +\$share, sauvegarde numéro \$num: +
      +\$fileListStr +
    +

    +Vous avez trois choix pour restaurer ces fichiers/repertoires. +Veuillez sélectionner une des options suivantes. +

    +\${h2("Option 1: Restauration directe")} +

    +Vous pouvez démarrer une restauration qui va restaurer ces fichiers +directement sur \$host. +

    +Attention: +tout les fichiers correspondant à ceux que vous avez sélectionnés vont être effacés ! + +

    + + + +\$hiddenStr + + + + + + + + + + + + + +
    Restaurer les fichiers vers l\'hôte
    Restaurer les fichiers vers le partage
    Restaurer les fichiers du répertoire
    (relatif au partage)
    +
    +EOF + + +# ------------------------------ +$Lang{Option_2__Download_Zip_archive} = < +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 Winzip, pour +voir ou extraire n\'importe quel fichier. +

    +Attention: 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. +

    +

    + + + +\$hiddenStr + + Faire l\'archive relative à +\${EscapeHTML(\$pathHdr eq "" ? "/" : \$pathHdr)} +(Autrement l\'archive contiendra les chemins complets). +
    +Compression (0=désactivée, 1=rapide,...,9=meilleure) + +
    + +
    +EOF + + +# ------------------------------ + +$Lang{Option_2__Download_Zip_archive2} = < +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 www.cpan.org. +

    +EOF + + +# ------------------------------ +$Lang{Option_3__Download_Zip_archive} = < + +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 tar ou winzip pour voir ou extraire n\'importe quel fichier. +

    +Attention: 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. +

    +

    + + + +\$hiddenStr + + Faire l\'archive relative à +\${EscapeHTML(\$pathHdr eq "" ? "/" : \$pathHdr)} +(Autrement l\'archive contiendra des chemins absolus). +
    + +
    +EOF + + + +# ------------------------------ +$Lang{Restore_Confirm_on__host} = "BackupPC: Confirmation de restauration sur \$host"; + +$Lang{Are_you_sure} = < +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: +

    + + +\$fileListStr +
    Fichier/Répertoire originalVa être restauré à
    + +

    + + + + + + +\$hiddenStr +Voulez-vous vraiment le faire ? + + +
    +EOF + +# -------------------------- +$Lang{Restore_Requested_on__hostDest} = "BackupPC: Restauration demandée sur \$hostDest"; +$Lang{Reply_from_server_was___reply} = < +La réponse du serveur est: \$reply +

    +Retourner à la page d\'acceuil de \$hostDest . +EOF + + +# ------------------------- +$Lang{Host__host_Backup_Summary} = "BackupPC: Résumé de la sauvegarde de l\'hôte \$host "; + +$Lang{Host__host_Backup_Summary2} = < +\$warnStr +

      +\$statusStr +
    + +\${h2("Actions de l\'utilisateur")} +

    +

    + +\$startIncrStr + + +
    + +\${h2("Résumé de la sauvegarde")} +

    +Cliquer sur le numéro de l\'archive pour naviguer et restaurer les fichiers de sauvegarde. + + + + + + + + + +\$str +
    Sauvegarde n° Type terminée Date de démarrage Durée/mins Age/jours Chemin d\'accès sauvegarde sur serveur
    +

    + +\$restoreStr + +\${h2("Résumé des erreurs de transfert")} +

    + + + + + + + + + +\$errStr +
    Nb sauvegarde Type View Nb erreurs transfert Nb mauvais fichiers Nb mauvais partages Nb erreurs tar
    +

    + +\${h2("Résumé de Taille fichier/Nombre de réutilisations")} +

    + 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. + + + + + + + + + + + + + + + + + + +\$sizeStr +
    Totaux Fichiers existants Nouveaux fichiers
    Nb de sauvegarde Type Nb de Fichiers Taille/Mo Mo/sec Nb de Fichiers Taille/MB Nb de Fichiers Taille/Mo
    +

    + +\${h2("Résumé de la compression")} +

    + +Performance de compression pour les fichiers déjà sur le serveur et +récemment compressés. + + + + + + + + + + + + + + + + +\$compStr +
    Fichiers existants Nouveaux fichiers
    Nb de sauvegardes Type Niveau de Compression Taille/Mo Comp/Mo Comp Taille/Mo Comp/Mo Compression
    +

    +EOF + +# ------------------------- +$Lang{Error} = "BackupPC: Erreur"; +$Lang{Error____head} = <\$mesg

    +EOF + +# ------------------------- +$Lang{NavSectionTitle_} = "Serveur"; + + +# ------------------------- +$Lang{Backup_browse_for__host} = < + + + +
      +
    • Vous naviguez dans la sauvegarde n°\$num, qui a commencé vers \$backupTime + (il y a \$backupAge jours), +\$filledBackup +
    • Cliquer dans un répertoire ci-dessous pour naviguer dedans, +
    • Cliquer dans un fichier ci-dessous pour le restaurer.. +
    + +\${h2("Contenu de \${EscapeHTML(\$dirDisplay)}")} +
    + + + + +
    + +
    + +
    + \$dirStr +
    +
    + + +
    +
    + + \$fileHeader + \$topCheckAll + \$fileStr + \$checkAll +
    +
    +
    + +
    +
    +EOF + + +# ------------------------------ + +# FIXME +$Lang{Restore___num_details_for__host} = "BackupPC: Restore #\$num details for \$host"; + +$Lang{Restore___num_details_for__host2 } = < + + + + + + + + + + + + + + + + + + + +
    Number \$Restores[\$i]{num}
    Requested by \$RestoreReq{user}
    Request time \$reqTime
    Result \$Restores[\$i]{result}
    Error Message \$Restores[\$i]{errorMsg}
    Source host \$RestoreReq{hostSrc}
    Source backup num \$RestoreReq{num}
    Source share \$RestoreReq{shareSrc}
    Destination host \$RestoreReq{hostDest}
    Destination share \$RestoreReq{shareDest}
    Start time \$startTime
    Duration \$duration min
    Number of files \$Restores[\$i]{nFiles}
    Total size \${MB} Mo
    Transfer rate \$MBperSec Mo/sec
    TarCreate errors \$Restores[\$i]{tarCreateErrs}
    Xfer errors \$Restores[\$i]{xferErrs}
    Xfer log file +View, +Erreurs +
    +

    +\${h1("Liste Fichiers/Répertoires")} +

    + + +\$fileListStr +
    Fichier/répertoire originalRestauré vers
    +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} = < +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} = "Hôte ou Nom d\'utilisateur:"; +$Lang{Go} = "Chercher"; +$Lang{Hosts} = "Hôtes"; + +$Lang{This_PC_has_never_been_backed_up} = "

    Ce PC n'a jamais été sauvegardé !!

    \n"; +$Lang{This_PC_is_used_by} = "
  • Ce PC est utilisé par \${UserLink(\$user)}"; + +# ------------ +$Lang{Last_email_sent_to__was_at___subject} = <Dernier email envoyé à \${UserLink(\$user)} le \$mailTime, avait comme sujet "\$subj". +EOF +# ------------ +$Lang{The_command_cmd_is_currently_running_for_started} = <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} = <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} = <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} = <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} = <L\'état courant est \"\$StatusHost{state}\"\$reason + à compter du \$startTime. +EOF + +# -------- +$Lang{Last_error_is____EscapeHTML_StatusHost_error} = <La dernière erreur est \"\${EscapeHTML(\$StatusHost{error})}\" +EOF + +# ------ +$Lang{Pings_to_host_have_failed_StatusHost_deadCnt__consecutive_times} = <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} = <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___} = <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} = <Les sauvegardes sont reportées pour \$hours heures +(changer ce nombre). +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} = < + Tout sélectionner + + + +EOF + +$Lang{fileHeader} = < Nom + Type + Mode + Taille + Date modification + +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} = < Cet affichage est regroupé avec la sauvegarde n°\$numF, la plus récente copie intégrale. +EOF + +$Lang{Restore_Summary} = < +Cliquer sur le numéro de restauration pour plus de détails. + + + + + + + + + + +\$restoreStr +
    Sauvegarde n° Résultat Date de départ Durée/mins Nb fichiers Mo Nb errs tar Nb errs trans
    +

    +EOF + +$Lang{BackupPC__Documentation} = "BackupPC: Documentation"; + +$Lang{No} = "non"; +$Lang{Yes} = "oui"; + +$Lang{The_directory_is_empty} = <Le repertoire \${EscapeHTML(\$dirDisplay)} est vide + +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 diff --git a/lib/BackupPC/Lib.pm b/lib/BackupPC/Lib.pm index b77c778..02177a0 100644 --- a/lib/BackupPC/Lib.pm +++ b/lib/BackupPC/Lib.pm @@ -39,7 +39,7 @@ package BackupPC::Lib; use strict; -use vars qw(%Conf); +use vars qw(%Conf %Lang); use Fcntl qw/:flock/; use Carp; use DirHandle (); @@ -54,8 +54,9 @@ sub new 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 @@ -106,6 +107,12 @@ sub Conf return %{$self->{Conf}}; } +sub Lang +{ + my($self) = @_; + return $self->{Lang}; +} + sub adminJob { return " admin "; @@ -248,6 +255,14 @@ sub ConfigRead } %{$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; } @@ -276,17 +291,19 @@ sub HostInfoRead if ( !open(HOST_INFO, "$self->{TopDir}/conf/hosts") ) { print(STDERR $self->timeStamp, "Can't open $self->{TopDir}/conf/hosts\n"); - return; + return {}; } while ( ) { 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; diff --git a/makeDist b/makeDist index 96998e7..d4d5c81 100755 --- a/makeDist +++ b/makeDist @@ -30,6 +30,8 @@ my @PerlSrc = qw( 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 -- 2.20.1