"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "lib/BackupPC/Storage.pm" between
BackupPC-4.3.2.tar.gz and BackupPC-4.4.0.tar.gz

About: BackupPC is a high-performance, enterprise-grade system for backing up Linux and WinXX PCs and laptops to a server’s disk (http/cgi user interface).

Storage.pm  (BackupPC-4.3.2):Storage.pm  (BackupPC-4.4.0)
skipping to change at line 31 skipping to change at line 31
# This program is distributed in the hope that it will be useful, # This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of # but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
# #
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
# #
#======================================================================== #========================================================================
# #
# Version 4.3.2, released 17 Feb 2020. # Version 4.4.0, released 20 Jun 2020.
# #
# See http://backuppc.sourceforge.net. # See http://backuppc.sourceforge.net.
# #
#======================================================================== #========================================================================
package BackupPC::Storage; package BackupPC::Storage;
use strict; use strict;
use BackupPC::Storage::Text; use BackupPC::Storage::Text;
use Data::Dumper; use Data::Dumper;
sub new sub new
{ {
my $class = shift; my $class = shift;
my($paths) = @_; my($paths) = @_;
my $flds = { my $flds = {
BackupFields => [qw( BackupFields => [qw(
num type startTime endTime num type startTime endTime nFiles size nFilesExist sizeExist
nFiles size nFilesExist sizeExist nFilesNew sizeNew nFilesNew sizeNew xferErrs xferBadFile xferBadShare tarErrs
xferErrs xferBadFile xferBadShare tarErrs compress sizeExistComp sizeNewComp noFill fillFromNum mangle
compress sizeExistComp sizeNewComp xferMethod level charset version inodeLast keep share2path
noFill fillFromNum mangle xferMethod level comment
charset version inodeLast )],
)],
RestoreFields => [qw( RestoreFields => [qw(
num startTime endTime result errorMsg nFiles size num startTime endTime result errorMsg nFiles size
tarCreateErrs xferErrs tarCreateErrs xferErrs
)], )],
ArchiveFields => [qw( ArchiveFields => [qw(
num startTime endTime result errorMsg num startTime endTime result errorMsg
)], )],
}; };
return BackupPC::Storage::Text->new($flds, $paths, @_); return BackupPC::Storage::Text->new($flds, $paths, @_);
} }
# #
# Writes per-backup information into the pc/nnn/backupInfo # Writes per-backup information into the pc/nnn/backupInfo
# file to allow later recovery of the pc/backups file in # file to allow later recovery of the pc/backups file in
# cases when it is corrupted. # cases when it is corrupted.
# #
# Also updates the directory mtime to reflect the backup # Also updates the directory mtime to reflect the backup
# finish time. # finish time.
# #
sub backupInfoWrite sub backupInfoWrite
{ {
my($class, $pcDir, $bkupNum, $bkupInfo, $force) = @_; my($class, $pcDir, $bkupNum, $bkupInfo, $force) = @_;
my $bkupFd; my $bkupFd;
return if ( !$force && -f "$pcDir/$bkupNum/backupInfo" ); return if ( !$force && -f "$pcDir/$bkupNum/backupInfo" );
my($dump) = Data::Dumper->new( my($dump) = Data::Dumper->new([$bkupInfo], [qw(*backupInfo)]);
[ $bkupInfo],
[qw(*backupInfo)]);
$dump->Indent(1); $dump->Indent(1);
$dump->Sortkeys(1);
if ( open($bkupFd, ">", "$pcDir/$bkupNum/backupInfo") ) { if ( open($bkupFd, ">", "$pcDir/$bkupNum/backupInfo") ) {
print($bkupFd $dump->Dump); print($bkupFd $dump->Dump);
close($bkupFd); close($bkupFd);
} else { } else {
print("backupInfoWrite: can't open/create $pcDir/$bkupNum/backupInfo\n") ; print("backupInfoWrite: can't open/create $pcDir/$bkupNum/backupInfo\n") ;
} }
utime($bkupInfo->{endTime}, $bkupInfo->{endTime}, "$pcDir/$bkupNum") utime($bkupInfo->{endTime}, $bkupInfo->{endTime}, "$pcDir/$bkupNum")
if ( defined($bkupInfo->{endTime}) ); if ( defined($bkupInfo->{endTime}) );
} }
1; 1;
 End of changes. 9 change blocks. 
19 lines changed or deleted 17 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)