X-Git-Url: http://git.rot13.org/?p=BackupPC.git;a=blobdiff_plain;f=bin%2FBackupPC_fixupBackupSummary;h=dc9db98e4c4e39062205c288a7c825293d04db17;hp=c163b99a419efe35e056261bb20c70e378f19a23;hb=fda25dc88a63ccac1c80efa2e4994bf0725ca9b7;hpb=617af75f7419e95a9c3ea05b05cf21957acc331c diff --git a/bin/BackupPC_fixupBackupSummary b/bin/BackupPC_fixupBackupSummary index c163b99..dc9db98 100755 --- a/bin/BackupPC_fixupBackupSummary +++ b/bin/BackupPC_fixupBackupSummary @@ -12,7 +12,7 @@ # Craig Barratt # # COPYRIGHT -# Copyright (C) 2005 Craig Barratt +# Copyright (C) 2005-2007 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 @@ -30,7 +30,7 @@ # #======================================================================== # -# Version 3.0.0alpha, released 23 Jan 2006. +# Version 3.1.0, released 25 Nov 2007. # # See http://backuppc.sourceforge.net. # @@ -153,13 +153,12 @@ foreach my $host ( @hostList ) { } print(" Reading $file\n"); while ( (my $str = $f->readLine()) ne "" ) { - if ( $str =~ /^(\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}) (full|incr|partial) backup started for directory / ) { - $startTime = $str; + if ( $str =~ /^(\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}) (full|incr|partial) backup started / ) { + $startTime = parsedate($1); next; } next if ( $str !~ /^(\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}) (full|incr|partial) backup (\d+) complete, (\d+) files, (\d+) bytes, (\d+) xferErrs \((\d+) bad files, (\d+) bad shares, (\d+) other\)/ ); - my $endTime = $1; my $type = $2; my $bkupNum = $3; my $nFilesTotal = $4; @@ -167,13 +166,14 @@ foreach my $host ( @hostList ) { my $xferErrs = $6; my $badFiles = $7; my $badShare = $8; + my $endTime = parsedate($1); print(" Got $type backup $bkupNum at $endTime\n"); - next if ( !-d "$dir/$2" ); + next if ( !-d "$dir/$bkupNum" ); $BkupFromLOG->{$bkupNum} = { num => $bkupNum, type => $type, - startTime => parsedate($startTime), - endTime => parsedate($endTime), + startTime => $startTime, + endTime => $endTime, size => $sizeTotal, nFiles => $nFilesTotal, xferErrs => $xferErrs, @@ -232,7 +232,8 @@ foreach my $host ( @hostList ) { if ( $changes ) { @Backups = sort({$a->{num} <=> $b->{num}} @Backups); - print Dumper \@Backups; + # print Dumper \@Backups; + $bpc->BackupInfoWrite($host, @Backups); } else { print(" No changes for host $host\n"); }