1 #============================================================= -*-perl-*-
3 # BackupPC::Xfer::Archive package
7 # This library defines a BackupPC::Xfer::Archive class for managing
11 # Craig Barratt <cbarratt@users.sourceforge.net>
14 # Copyright (C) 2001-2009 Craig Barratt
16 # This program is free software; you can redistribute it and/or modify
17 # it under the terms of the GNU General Public License as published by
18 # the Free Software Foundation; either version 2 of the License, or
19 # (at your option) any later version.
21 # This program is distributed in the hope that it will be useful,
22 # but WITHOUT ANY WARRANTY; without even the implied warranty of
23 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 # GNU General Public License for more details.
26 # You should have received a copy of the GNU General Public License
27 # along with this program; if not, write to the Free Software
28 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
30 #========================================================================
32 # Version 3.2.0, released 31 Jul 2010.
34 # See http://backuppc.sourceforge.net.
36 #========================================================================
38 package BackupPC::Xfer::Archive;
41 use base qw(BackupPC::Xfer::Protocol);
45 return "Archive Started";
52 my $conf = $t->{conf};
54 my(@HostList, @BackupList, $archiveClientCmd, $archiveClientCmd2, $logMsg);
56 $archiveClientCmd = $conf->{ArchiveClientCmd};
58 @HostList = $t->{HostList};
59 @BackupList = $t->{BackupList};
61 my $tarCreatePath = "$conf->{InstallDir}/bin/BackupPC_tarCreate";
62 while (${@HostList[0]}[$i]) {
64 # Merge variables into @archiveClientCmd
68 archiveloc => $t->{archiveloc},
69 parfile => $t->{parfile},
70 compression => $t->{compression},
71 compext => $t->{compext},
72 splitsize => $t->{splitsize},
73 host => ${@HostList[0]}[$i],
74 backupnumber => ${@BackupList[0]}[$i],
75 Installdir => $conf->{InstallDir},
76 tarCreatePath => $tarCreatePath,
77 splitpath => $conf->{SplitPath},
78 parpath => $conf->{ParPath},
81 $archiveClientCmd2 = $bpc->cmdVarSubstitute($archiveClientCmd,
83 $t->{XferLOG}->write(\"Executing: @$archiveClientCmd2\n");
85 $bpc->cmdSystemOrEvalLong($archiveClientCmd2,
88 $t->{XferLOG}->write(\$_[0]);
89 }, 0, $t->{pidHandler});
91 ($t->{_errStr} = $errStr) =~ s/[\n\r]+//;
96 $t->{XferLOG}->write(\"Completed Archive\n");
97 return "Completed Archive";