X-Git-Url: http://git.rot13.org/?p=BackupPC.git;a=blobdiff_plain;f=bin%2FBackupPC_fixupBackupSummary;h=c5402dc58ef7624438605014bccdf9d9cd35059d;hp=70177d5dbb3006f3a60bbdaf8f4dbaa26eb77aef;hb=06017d5181d9c62f8cbd1c6d58d831f54d7d4ad1;hpb=df717077755b9331fa245f72933ef03add7a3710 diff --git a/bin/BackupPC_fixupBackupSummary b/bin/BackupPC_fixupBackupSummary index 70177d5..c5402dc 100755 --- a/bin/BackupPC_fixupBackupSummary +++ b/bin/BackupPC_fixupBackupSummary @@ -1,4 +1,4 @@ -#!/bin/perl +#!/usr/bin/perl #============================================================= -*-perl-*- # # BackupPC_fixupBackupSummary: recreate backups file in case @@ -12,7 +12,7 @@ # Craig Barratt # # COPYRIGHT -# Copyright (C) 2005 Craig Barratt +# Copyright (C) 2005-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 @@ -30,7 +30,7 @@ # #======================================================================== # -# Version 3.0.0beta1, released 30 Jul 2006. +# Version 3.2.0, released 31 Jul 2010. # # 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"); }