#
#========================================================================
#
-# Version 2.1.0_CVS, released 3 Jul 2003.
+# Version 2.1.0beta0, released 20 Mar 2004.
#
# See http://backuppc.sourceforge.net.
#
sub action
{
+ my $archHost = $In{host};
+ my $Privileged = CheckPermission();
+
+ if ( !$Privileged ) {
+ ErrorExit($Lang->{Only_privileged_users_can_archive} );
+ }
if ( $In{type} == 0 ) {
my($fullTot, $fullSizeTot, $incrTot, $incrSizeTot, $str,
- $strNone, $strGood, $hostCntGood, $hostCntNone, $checkBoxCnt,
- $backupnumber);
+ $strNone, $strGood, $hostCntGood, $hostCntNone, $checkBoxCnt,
+ $backupnumber);
$hostCntGood = $hostCntNone = $checkBoxCnt = $fullSizeTot = 0;
GetStatusInfo("hosts");
- my $Privileged = CheckPermission();
- if ( !$Privileged ) {
- ErrorExit($Lang->{Only_privileged_users_can_archive} );
- }
foreach my $host ( sort(keys(%Status)) ) {
my($fullDur, $incrCnt, $fullSize, $fullRate);
my @Backups = $bpc->BackupInfoRead($host);
$fullSizeTot += $fullSize + $incrSizeTot;
$fullSize = sprintf("%.2f", ($fullSize + $incrSizeTot) / 1000);
$str = <<EOF;
-<tr bgcolor="#ffffcc">
-<td><input type="hidden" name="backup$checkBoxCnt" value="$backupnumber"><input type="checkbox" name="fcb$checkBoxCnt" value="$host"> ${HostLink($host)} </td>
-<td align="center"> ${UserLink($Hosts->{$host}{user})} </td>
-<td align="center"> $fullSize </td>
+<tr>
+<td class="border"><input type="hidden" name="backup$checkBoxCnt" value="$backupnumber"><input type="checkbox" name="fcb$checkBoxCnt" value="$host"> ${HostLink($host)} </td>
+<td align="center" class="border"> ${UserLink($Hosts->{$host}{user})} </td>
+<td align="center" class="border"> $fullSize </td>
EOF
$checkBoxCnt++;
if ( @Backups == 0 ) {
$strGood .= <<EOF;
<input type="hidden" name="archivehost" value="$In{'archivehost'}">
EOF
- Header($Lang->{BackupPC__Archive});
- print eval ("qq{$Lang->{BackupPC_Archive}}");
-
+ my $content = eval("qq{$Lang->{BackupPC_Archive}}");
+ Header(eval("qq{$Lang->{BackupPC__Archive}}"), $content, 1);
Trailer();
} else {
-
- my(@HostList, @BackupList, $HostListStr, $hiddenStr, $pathHdr, $badFileCnt, $reply, $str);
-
- my $Privileged = CheckPermission();
+ my(@HostList, @BackupList, $HostListStr, $hiddenStr, $pathHdr,
+ $badFileCnt, $reply, $str);
my $args = {
SplitPath => $bpc->{Conf}{SplitPath},
ParPath => $bpc->{Conf}{ParPath},
topDir => $bpc->{TopDir},
};
- if ( !$Privileged ) {
- ErrorExit($Lang->{Only_privileged_users_can_archive} );
- }
ServerConnect();
for ( my $i = 0 ; $i < $In{fcbMax} ; $i++ ) {
if ( @HostList == 0 ) {
ErrorExit($Lang->{You_haven_t_selected_any_hosts});
}
- my ($ArchiveDest, $ArchiveCompNone, $ArchiveCompGzip, $ArchiveCompBzip2, $ArchivePar, $ArchiveSplit);
- $ArchiveDest = $bpc->{Conf}{ArchiveDest};
+ my ($ArchiveDest, $ArchiveCompNone, $ArchiveCompGzip,
+ $ArchiveCompBzip2, $ArchivePar, $ArchiveSplit);
+ $ArchiveDest = $bpc->{Conf}{ArchiveDest};
if ( $bpc->{Conf}{ArchiveComp} eq "none" ) {
$ArchiveCompNone = "checked";
} else {
} else {
$ArchiveCompBzip2 = "";
}
- $ArchivePar = $bpc->{Conf}{ArchivePar};
- $ArchiveSplit = $bpc->{Conf}{ArchiveSplit};
+ $ArchivePar = $bpc->{Conf}{ArchivePar};
+ $ArchiveSplit = $bpc->{Conf}{ArchiveSplit};
if ( $In{type} == 1 ) {
#
# Tell the user what options they have
#
-
- Header($Lang->{BackupPC__Archive});
- print eval ("qq{$Lang->{BackupPC_Archive2}}");
+ my $paramStr = "";
+ if ( $bpc->{Conf}{ArchiveClientCmd} =~ /\$archiveloc\b/ ) {
+ $paramStr .= eval("qq{$Lang->{BackupPC_Archive2_location}}");
+ }
+ if ( $bpc->{Conf}{ArchiveClientCmd} =~ /\$compression\b/ ) {
+ $paramStr .= eval("qq{$Lang->{BackupPC_Archive2_compression}}");
+ }
+ if ( $bpc->{Conf}{ArchiveClientCmd} =~ /\$parfile\b/
+ && -x $bpc->{Conf}{ParPath} ) {
+ $paramStr .= eval("qq{$Lang->{BackupPC_Archive2_parity}}");
+ }
+ if ( $bpc->{Conf}{ArchiveClientCmd} =~ /\$splitsize\b/
+ && -x $bpc->{Conf}{SplitPath} ) {
+ $paramStr .= eval("qq{$Lang->{BackupPC_Archive2_split}}");
+ }
+ my $content = eval("qq{$Lang->{BackupPC_Archive2}}");
+ Header(eval("qq{$Lang->{BackupPC__Archive}}"), $content, 1);
Trailer();
} elsif ( $In{type} == 2 ) {
my $reqFileName;
$reqFileName = "archiveReq.$$.$i";
last if ( !-f "$TopDir/pc/$archivehost/$reqFileName" );
}
- my $compname;
- if ( $In{compression} == 2 ) { # bzip2 compression
+ my($compname, $compext);
+ if ( $In{compression} == 2 ) { # bzip2 compression
$compname = $Conf{Bzip2Path};
- } elsif ( $In{compression} == 1 ) { # gzip compression
- $compname = $Conf{GzipPath};
- } else { # No Compression
- $compname = $Conf{CatPath};
- }
- my $compext;
- if ( $In{compression} == 2 ) { # bzip2 compression
$compext = '.bz2';
- } elsif ( $In{compression} == 1 ) { # gzip compression
+ } elsif ( $In{compression} == 1 ) { # gzip compression
+ $compname = $Conf{GzipPath};
$compext = '.gz';
} else { # No Compression
+ $compname = $Conf{CatPath};
$compext = '.raw';
}
my $fullsplitsize = $In{splitsize} . '000000';
splitsize => $fullsplitsize,
host => $archivehost,
-
# list of hosts to restore
HostList => \@HostList,
BackupList => \@BackupList,
} else {
ErrorExit($Lang->{Can_t_open_create} );
}
- $reply = $bpc->ServerMesg("archive $User $archivehost $reqFileName");
+ $reply = $bpc->ServerMesg("archive $User $archivehost $reqFileName");
+ $str = eval("qq{$Lang->{Archive_requested}}");
- $str = eval("qq{$Lang->{Archive_requested}}");
- Header($Lang->{BackupPC__Archive});
- print eval ("qq{$Lang->{BackupPC_Archive_Reply_from_server}}");
+ my $content = eval("qq{$Lang->{BackupPC_Archive_Reply_from_server}}");
+ Header(eval("qq{$Lang->{BackupPC__Archive}}"), $content, 1);
Trailer();
}
-
}
-
}
1;