From 270c64e7587580331979bb3f3335db3642df663c Mon Sep 17 00:00:00 2001 From: "Peter J. Holzer" Date: Sun, 31 Jan 2021 13:47:59 +0100 Subject: [PATCH] Log statistics in backup2disk Backups are running in child processes so the CA object in the parent is never updated. And per-fileset statistics are more interesting than the total anyway. --- lib/Simba/CA.pm | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/Simba/CA.pm b/lib/Simba/CA.pm index d76ff74..964f591 100644 --- a/lib/Simba/CA.pm +++ b/lib/Simba/CA.pm @@ -197,13 +197,6 @@ sub run { $self->backup2disk($target); } } - $self->log(3, "statistics:"); - for (sort keys %{ $self->{counts} }) { - $self->log(3, " $_: $self->{counts}{$_}"); - } - for (sort keys %{ $self->{times} }) { - $self->log(3, " $_: $self->{times}{$_} s"); - } $self->export(); } @@ -281,6 +274,14 @@ sub backup2disk { $self->release_fileset($target); $self->log(3, "finished backup for target host " . $target->{host} . " dir " . $target->{dir} . ": $count files"); $self->{counts}{objects} += $count; + + $self->log(3, "statistics:"); + for (sort keys %{ $self->{counts} }) { + $self->log(3, " $_: $self->{counts}{$_}"); + } + for (sort keys %{ $self->{times} }) { + $self->log(3, " $_: $self->{times}{$_} s"); + } } sub reserve_fileset {