mirror of https://github.com/digint/btrbk
btrbk: add up-to-date flag to stats; print "target/snapthot_name.*" instead of just "target" in stats
parent
f21ef824a7
commit
8a29ced0c9
14
btrbk
14
btrbk
|
@ -2967,8 +2967,16 @@ MAIN:
|
||||||
my $svol = $config_subvol->{svol} || die;
|
my $svol = $config_subvol->{svol} || die;
|
||||||
my $snapshot_name = config_key($config_subvol, "snapshot_name") // die;
|
my $snapshot_name = config_key($config_subvol, "snapshot_name") // die;
|
||||||
my @snapshot_children = get_snapshot_children($sroot, $svol);
|
my @snapshot_children = get_snapshot_children($sroot, $svol);
|
||||||
$stats_snapshots_total += scalar(@snapshot_children);
|
my $stats_snapshot_uptodate = "";
|
||||||
push @stats_data, [ $svol->{PRINT}, sprintf("%3u snapshots", scalar(@snapshot_children)) ];
|
foreach my $snapshot (@snapshot_children) {
|
||||||
|
if($snapshot->{cgen} == $svol->{gen}) {
|
||||||
|
$stats_snapshot_uptodate = " (up-to-date)";
|
||||||
|
last;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
push @stats_data, [ $svol->{PRINT}, sprintf("%4u snapshots$stats_snapshot_uptodate", scalar(@snapshot_children)) ];
|
||||||
|
$stats_snapshots_total += scalar(@snapshot_children); # NOTE: this adds ALL snaphot children under $sroot (not only the ones created by btrbk!)
|
||||||
|
|
||||||
foreach my $config_target (@{$config_subvol->{TARGET}}) {
|
foreach my $config_target (@{$config_subvol->{TARGET}}) {
|
||||||
next if($config_target->{ABORTED});
|
next if($config_target->{ABORTED});
|
||||||
my $droot = $config_target->{droot} || die;
|
my $droot = $config_target->{droot} || die;
|
||||||
|
@ -3032,7 +3040,7 @@ MAIN:
|
||||||
push @stats_detail, "$stats_incomplete incomplete" if($stats_incomplete);
|
push @stats_detail, "$stats_incomplete incomplete" if($stats_incomplete);
|
||||||
my $stats_detail_print = join(', ', @stats_detail);
|
my $stats_detail_print = join(', ', @stats_detail);
|
||||||
$stats_detail_print = " ($stats_detail_print)" if($stats_detail_print);
|
$stats_detail_print = " ($stats_detail_print)" if($stats_detail_print);
|
||||||
push @stats_data, [ "^-- $droot->{PRINT}", sprintf("%3u backups$stats_detail_print", $stats_total) ];
|
push @stats_data, [ "^-- $droot->{PRINT}/$snapshot_name.*", sprintf("%4u backups$stats_detail_print", $stats_total) ];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue