From 0ed455830d1d55e39b895388539200480c928776 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Tue, 21 Nov 2017 19:32:14 +0100 Subject: borg_list_time: Fix parsing for borg >=1.1 Output now contains additional data after the date. Signed-off-by: Florian Pritz --- lib/App/BorgRestore/Borg.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/App/BorgRestore/Borg.pm b/lib/App/BorgRestore/Borg.pm index 89a0b3a..31511de 100644 --- a/lib/App/BorgRestore/Borg.pm +++ b/lib/App/BorgRestore/Borg.pm @@ -53,7 +53,8 @@ method borg_list_time() { run [qw(borg list), $self->{borg_repo}], '>', \my $output or die $log->error("borg list returned $?")."\n"; for (split/^/, $output) { - if (m/^([^\s]+)\s+(.+)$/) { + # example timestamp: "Wed, 2016-01-27 10:31:59" = 24 chars + if (m/^([^\s]+)\s+(.{24})/) { my $time = App::BorgRestore::Helper::parse_borg_time($2); if ($time) { push @archives, { -- cgit v1.2.3-24-g4f1b