my %opt;
-if ( !getopts("cdm:v:ijf", \%opt ) ) {
+if ( !getopts("cdm:v:ijfq", \%opt ) ) {
print STDERR <<EOF;
usage: $0 [-c|-d] [-m num] [-v|-v level] [-i|-j|-f]
-i update Hyper Estraier full text index
-j update full text, don't check existing files
-f don't do anything with full text index
+ -q be quiet for hosts without changes
Option -j is variation on -i. It will allow faster initial creation
of full-text index from existing database.
}
$host_nr++;
- print "host ", $hosts->{$host_key}->{'host'}, " [",
- $host_nr, "/", ($#hosts + 1), "]: ";
-
# get backups for a host
my @backups = $bpc->BackupInfoRead($hostname);
my $incs = scalar @backups;
- print "$incs increments\n";
+ my $host_header = sprintf("host %s [%d/%d]: %d increments\n",
+ $hosts->{$host_key}->{'host'},
+ $host_nr,
+ ($#hosts + 1),
+ $incs
+ );
+ print $host_header unless ($opt{q});
+
my $inc_nr = 0;
$beenThere = {};
my $backupNum = $backup->{'num'};
my @backupShares = ();
- printf("%-10s %2d/%-2d #%-2d %s %5s/%5s files (date: %s dur: %s)\n",
+ my $share_header = sprintf("%-10s %2d/%-2d #%-2d %s %5s/%5s files (date: %s dur: %s)\n",
$hosts->{$host_key}->{'host'},
$inc_nr, $incs, $backupNum,
$backup->{type} || '?',
strftime($t_fmt,localtime($backup->{startTime})),
fmt_time($backup->{endTime} - $backup->{startTime})
);
+ print $share_header unless ($opt{q});
my $files = BackupPC::View->new($bpc, $hostname, \@backups, 1);
foreach my $share ($files->shareList($backupNum)) {
# skip if allready in database!
next if ($count > 0);
+ # dump host and share header for -q
+ if ($opt{q}) {
+ if ($host_header) {
+ print $host_header;
+ $host_header = undef;
+ }
+ print $share_header;
+ }
+
# dump some log
print curr_time," ", $share;