X-Git-Url: http://git.rot13.org/?p=BackupPC.git;a=blobdiff_plain;f=bin%2FBackupPC_fixupBackupSummary;h=502845f3f036cc8a2a69a620bfc4f6214d556455;hp=70177d5dbb3006f3a60bbdaf8f4dbaa26eb77aef;hb=b81d2da5e16975674f011e4833337ac0fa24e0ea;hpb=df717077755b9331fa245f72933ef03add7a3710 diff --git a/bin/BackupPC_fixupBackupSummary b/bin/BackupPC_fixupBackupSummary index 70177d5..502845f 100755 --- a/bin/BackupPC_fixupBackupSummary +++ b/bin/BackupPC_fixupBackupSummary @@ -30,7 +30,7 @@ # #======================================================================== # -# Version 3.0.0beta1, released 30 Jul 2006. +# Version 3.0.0beta2, released 11 Nov 2006. # # 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"); }