#---- subs ----
+sub status {
+ my $text = shift;
+ $text =~ s{\s+$}{};
+ my $new = $0;
+ $new =~ s{^[\w\/]+/(\w+) }{$1 }; # strip path from process name
+ if ( $text =~ m/^\|/ ) {
+ $new =~ s/\|.*/$text/ or $new .= " $text";
+ } else {
+ $new =~ s/\s+.*/ $text/ or $new .= " $text";
+ }
+ $0 = $new;
+}
+
sub fmt_time {
my $t = shift || return;
my $out = "";
}
print "$added";
+ status "| $added";
$offset += EST_CHUNK;
});
$sth->{hosts_by_name} = $dbh->prepare(qq{
-SELECT ID FROM hosts WHERE name=?
+SELECT id FROM hosts WHERE name=?
});
$sth->{backups_count} = $dbh->prepare(qq{
fmt_time($backup->{endTime} - $backup->{startTime})
);
print $share_header unless $opt->quiet;
+ status "$hostname $backupNum $share_header";
my $files = BackupPC::View->new($bpc, $hostname, \@backups, { only_first => 1 });
}
my $dur = (time() - $t) || 1;
- printf(" %d/%d files %d/%d dirs %0.2f MB [%.2f/s dur: %s]\n",
+ my $status = sprintf("%d/%d files %d/%d dirs %0.2f MB [%.2f/s dur: %s]",
$nf, $f, $nd, $d,
($size / 1024 / 1024),
( ($f+$d) / $dur ),
fmt_time($dur)
);
+ print " $status\n";
+ status "$hostname $backupNum $status";
if ($nf + $nd > 0) {
+ status "$hostname $backupNum full-text | indexing";
eval { hest_update($hostID, $shareID, $backupNum) };
warn "ERROR: $@" if $@;
}