use BackupPC::View;
use Data::Dumper;
use Getopt::Std;
+use Time::HiRes qw/time/;
+use POSIX qw/strftime/;
use constant BPC_FTYPE_DIR => 5;
my $debug = 0;
$|=1;
+my $t_fmt = '%Y-%m-%d %H:%M:%S';
+
my $hosts;
my $bpc = BackupPC::Lib->new || die;
my %Conf = $bpc->Conf();
my $backupNum = $backup->{'num'};
my @backupShares = ();
- print $hosts->{$host_key}->{'host'},"\t#$backupNum\n";
+ print $hosts->{$host_key}->{'host'}, "\t#$backupNum\n";
$sth->{backups_broj}->execute($hostID, $backupNum);
my ($broj) = $sth->{backups_broj}->fetchrow_array();
my $files = BackupPC::View->new($bpc, $hostname, \@backups, 1);
foreach my $share ($files->shareList($backupNum)) {
- print "\t$share";
+ my $t = time();
+
+ print strftime($t_fmt,localtime())," ", $share;
$shareID = getShareID($share, $hostID, $hostname);
my ($f, $nf, $d, $nd) = recurseDir($bpc, $hostname, $files, $backupNum, $share, "", $shareID);
- print " $nf/$f files $nd/$d dirs\n";
+ printf(" %d/%d files %d/%d dirs [%.2f/s]\n",
+ $nf, $f, $nd, $d,
+ ( ($f+$d) / ((time() - $t) || 1) )
+ );
$dbh->commit();
}