1 #============================================================= -*-perl-*-
3 # BackupPC::Storage package
7 # This library defines a BackupPC::Storage class for reading/writing
8 # data like config, host info, backup and restore info.
11 # Craig Barratt <cbarratt@users.sourceforge.net>
14 # Copyright (C) 2004-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::Storage;
41 use BackupPC::Storage::Text;
50 num type startTime endTime
51 nFiles size nFilesExist sizeExist nFilesNew sizeNew
52 xferErrs xferBadFile xferBadShare tarErrs
53 compress sizeExistComp sizeNewComp
54 noFill fillFromNum mangle xferMethod level
58 num startTime endTime result errorMsg nFiles size
59 tarCreateErrs xferErrs
62 num startTime endTime result errorMsg
66 return BackupPC::Storage::Text->new($flds, $paths, @_);
70 # Writes per-backup information into the pc/nnn/backupInfo
71 # file to allow later recovery of the pc/backups file in
72 # cases when it is corrupted.
76 my($class, $pcDir, $bkupNum, $bkupInfo, $force) = @_;
78 return if ( !$force && -f "$pcDir/$bkupNum/backupInfo" );
79 my($dump) = Data::Dumper->new(
83 if ( open(BKUPINFO, ">", "$pcDir/$bkupNum/backupInfo") ) {
84 print(BKUPINFO $dump->Dump);