#
#========================================================================
#
-# Version 2.1.0_CVS, released 3 Jul 2003.
+# Version 2.1.0_CVS, released 8 Feb 2004.
#
# See http://backuppc.sourceforge.net.
#
} elsif ( $type eq "RestoreErr" ) {
$file = "$TopDir/pc/$host/RestoreLOG$ext";
$comment = $Lang->{Extracting_only_Errors};
+ } elsif ( $type eq "ArchiveLOG" ) {
+ $file = "$TopDir/pc/$host/ArchiveLOG$ext";
+ } elsif ( $type eq "ArchiveErr" ) {
+ $file = "$TopDir/pc/$host/ArchiveLOG$ext";
+ $comment = $Lang->{Extracting_only_Errors};
} elsif ( $host ne "" && $type eq "config" ) {
$file = "$TopDir/pc/$host/config.pl";
$file = "$TopDir/conf/$host.pl"
$file = "$BinDir/../doc/BackupPC.html";
if ( open(LOG, $file) ) {
binmode(LOG);
- Header($Lang->{BackupPC__Documentation});
- print while ( <LOG> );
+ my $content;
+ $content .= $_ while ( <LOG> );
close(LOG);
+ Header($Lang->{BackupPC__Documentation}, $content);
Trailer();
} else {
ErrorExit(eval("qq{$Lang->{Unable_to_open__file__configuration_problem}}"));
$file .= ".z";
$compress = 1;
}
- Header(eval("qq{$Lang->{Backup_PC__Log_File__file}}") );
- print( eval ("qq{$Lang->{Log_File__file__comment}}"));
+ my $content;
+ $content .= 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 ( eval ("qq{$Lang->{Contents_of_log_file}}"));
+ $content .= ( eval ("qq{$Lang->{Contents_of_log_file}}"));
- print "<pre>";
+ $content .= "<pre>";
if ( $type eq "XferErr" || $type eq "XferErrbad"
- || $type eq "RestoreErr" ) {
+ || $type eq "RestoreErr"
+ || $type eq "ArchiveErr" ) {
my $skipped;
while ( 1 ) {
$_ = $fh->readLine();
if ( $_ eq "" ) {
- print(eval ("qq{$Lang->{skipped__skipped_lines}}"))
+ $content .= (eval ("qq{$Lang->{skipped__skipped_lines}}"))
if ( $skipped );
last;
}
if ( /smb: \\>/
|| /^\s*(\d+) \(\s*\d+\.\d kb\/s\) (.*)$/
|| /^tar: dumped \d+ files/
- || /^added interface/i
- || /^restore tar file /i
- || /^restore directory /i
- || /^tarmode is now/i
- || /^Total bytes written/i
- || /^Domain=/i
- || /^Getting files newer than/i
- || /^Output is \/dev\/null/
- || /^\([\d\.]* kb\/s\) \(average [\d\.]* kb\/s\)$/
+ || /^\s*added interface/i
+ || /^\s*restore tar file /i
+ || /^\s*restore directory /i
+ || /^\s*tarmode is now/i
+ || /^\s*Total bytes written/i
+ || /^\s*Domain=/i
+ || /^\s*Getting files newer than/i
+ || /^\s*Output is \/dev\/null/
+ || /^\s*\([\d.,]* kb\/s\) \(average [\d\.]* kb\/s\)$/
|| /^\s+directory \\/
- || /^Timezone is/
+ || /^\s*Timezone is/
+ || /^\s*creating lame (up|low)case table/i
|| /^\.\//
|| /^ /
) {
$skipped++;
next;
}
- print(eval("qq{$Lang->{skipped__skipped_lines}}"))
+ $content .= (eval("qq{$Lang->{skipped__skipped_lines}}"))
if ( $skipped );
$skipped = 0;
- print ${EscHTML($_)};
+ $content .= ${EscHTML($_)};
}
} elsif ( $linkHosts ) {
while ( 1 ) {
my $s = ${EscHTML($_)};
$s =~ s/\b([\w-]+)\b/defined($Hosts->{$1})
? ${HostLink($1)} : $1/eg;
- print $s;
+ $content .= $s;
}
} elsif ( $type eq "config" ) {
while ( 1 ) {
s/(SmbShareUserName.*=.*['"]).*(['"])/$1$2/ig;
s/(RsyncdPasswd.*=.*['"]).*(['"])/$1$2/ig;
s/(ServerMesgSecret.*=.*['"]).*(['"])/$1$2/ig;
- print ${EscHTML($_)};
+ $content .= ${EscHTML($_)};
}
} else {
while ( 1 ) {
$_ = $fh->readLine();
last if ( $_ eq "" );
- print ${EscHTML($_)};
+ $content .= ${EscHTML($_)};
}
}
$fh->close();
} else {
- printf( eval("qq{$Lang->{_pre___Can_t_open_log_file__file}}"));
+ $content .= ( eval("qq{$Lang->{_pre___Can_t_open_log_file__file}}"));
}
- print <<EOF;
+ $content .= <<EOF;
</pre>
EOF
+ Header(eval("qq{$Lang->{Backup_PC__Log_File__file}}"),
+ $content, !-f "$TopDir/pc/$host/backups" );
Trailer();
}