X-Git-Url: http://git.rot13.org/?p=BackupPC.git;a=blobdiff_plain;f=bin%2FBackupPC_fixupBackupSummary;h=70177d5dbb3006f3a60bbdaf8f4dbaa26eb77aef;hp=5bc5318d2489b95dd85546c8dd3cdbac9f5ec7dd;hb=refs%2Ftags%2Fv3_0_0beta1;hpb=546f9691f118c9ea2d164f377994b4a018a60d02 diff --git a/bin/BackupPC_fixupBackupSummary b/bin/BackupPC_fixupBackupSummary index 5bc5318..70177d5 100755 --- a/bin/BackupPC_fixupBackupSummary +++ b/bin/BackupPC_fixupBackupSummary @@ -30,7 +30,7 @@ # #======================================================================== # -# Version 2.1.0, released 20 Jun 2004. +# Version 3.0.0beta1, released 30 Jul 2006. # # See http://backuppc.sourceforge.net. # @@ -56,6 +56,17 @@ my $Hosts = $bpc->HostInfoRead(); my @hostList; our(%backupInfo); +my %opts; + +if ( !getopts("l", \%opts) ) { + print STDERR <BackupInfoRead($host); - # - # Temporary: create backupInfo files in each backup - # directory - # - foreach ( my $i = 0 ; $i < @Backups ; $i++ ) { - BackupPC::Storage->backupInfoWrite($dir, $Backups[$i]{num}, - $Backups[$i]); - if ( 0 ) { - my $bkupNum = $Backups[$i]{num}; - if ( !-f "$dir/$bkupNum/backupInfo" ) { - my($dump) = Data::Dumper->new( - [ $Backups[$i]], - [qw(*backupInfo)]); - $dump->Indent(1); - if ( open(BKUPINFO, ">", "$dir/$bkupNum/backupInfo") ) { - print(BKUPINFO $dump->Dump); - close(BKUPINFO); - } - } - } - } - # # Look through the LOG files to get information about # completed backups. The data from the LOG file is @@ -121,7 +110,7 @@ foreach my $host ( @hostList ) { my @files = readdir(DIR); closedir(DIR); foreach my $file ( @files ) { - if ( $file =~ /^LOG(.\d+\.z)?/ ) { + if ( $opts{l} && $file =~ /^LOG(.\d+\.z)?/ ) { push(@LogFiles, $file); } elsif ( $file =~ /^(\d+)$/ ) { my $bkupNum = $1; @@ -154,6 +143,7 @@ foreach my $host ( @hostList ) { # @LogFiles = sort({-M "$dir/$a" <=> -M "$dir/$b"} @LogFiles); my $startTime; + my $fillFromNum; foreach my $file ( @LogFiles ) { my $f = BackupPC::FileZIO->open("$dir/$file", 0, $file =~ /\.z/); @@ -197,14 +187,12 @@ foreach my $host ( @hostList ) { noFill => $type eq "incr" ? 1 : 0, level => $type eq "incr" ? 1 : 0, mangle => 1, - noFill => $noFill; - fillFromNum => $fillFromNum; + fillFromNum => $fillFromNum, }; + $fillFromNum = $bkupNum if ( $type eq "full" ); } } - splice(@Backups, 2, 1); - # # Now merge any info from $BkupFromInfo and $BkupFromLOG # that is missing from @Backups.