# Craig Barratt <cbarratt@users.sourceforge.net>
#
# COPYRIGHT
-# Copyright (C) 2004 Craig Barratt
+# Copyright (C) 2004-2009 Craig Barratt
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
#
#========================================================================
#
-# Version 2.1.0, released 20 Jun 2004.
+# Version 3.2.0, released 31 Jul 2010.
#
# See http://backuppc.sourceforge.net.
#
use strict;
use BackupPC::Storage::Text;
+use Data::Dumper;
sub new
{
xferErrs xferBadFile xferBadShare tarErrs
compress sizeExistComp sizeNewComp
noFill fillFromNum mangle xferMethod level
+ charset version
)],
RestoreFields => [qw(
num startTime endTime result errorMsg nFiles size
return BackupPC::Storage::Text->new($flds, $paths, @_);
}
+#
+# Writes per-backup information into the pc/nnn/backupInfo
+# file to allow later recovery of the pc/backups file in
+# cases when it is corrupted.
+#
+sub backupInfoWrite
+{
+ my($class, $pcDir, $bkupNum, $bkupInfo, $force) = @_;
+
+ return if ( !$force && -f "$pcDir/$bkupNum/backupInfo" );
+ my($dump) = Data::Dumper->new(
+ [ $bkupInfo],
+ [qw(*backupInfo)]);
+ $dump->Indent(1);
+ if ( open(BKUPINFO, ">", "$pcDir/$bkupNum/backupInfo") ) {
+ print(BKUPINFO $dump->Dump);
+ close(BKUPINFO);
+ }
+}
+
1;