2021-01-31 13:33:33 +01:00
|
|
|
#!/usr/bin/perl
|
|
|
|
use v5.24;
|
|
|
|
use warnings;
|
|
|
|
|
|
|
|
open my $tsfh, '>', "graph_used.tsv";
|
|
|
|
for my $fn (glob("/var/log/simba/ca.*")) {
|
2022-03-26 10:04:07 +01:00
|
|
|
my $fh;
|
|
|
|
if ($fn =~ /\.gz$/) {
|
|
|
|
open($fh, '-|', "zcat", $fn);
|
|
|
|
} else {
|
|
|
|
open ($fh, '<', $fn);
|
|
|
|
}
|
2021-01-31 13:33:33 +01:00
|
|
|
my %free;
|
|
|
|
while (<$fh>) {
|
|
|
|
if (m{(....-..-..T..:..:..[-+]....) .*: considering base /backup/(.*) \(est. (\d+) bytes\)}) {
|
|
|
|
$free{$2} = $3;
|
|
|
|
} elsif (m{(....-..-..T..:..:..[-+]....) .*: using base /backup/(.*)}) {
|
|
|
|
say $tsfh "$1\t$2\t$free{$2}"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
close $tsfh;
|
|
|
|
|
|
|
|
open STDOUT, '>', "graph_used.png";
|
|
|
|
system "tsplotv", "--style", "points", "--legend-position", "below", "graph_used.tsv";
|