From 29b9c8fc60fd1d2085b6ee1ed73e7ae10cb3c11e Mon Sep 17 00:00:00 2001 From: Axel Burri Date: Tue, 19 Apr 2016 18:57:22 +0200 Subject: [PATCH] btrbk: action "archive": abort if receive targets of archive candidates exist at unexpected location. makes sure we dont have duplicates on our archives --- btrbk | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/btrbk b/btrbk index f31a854..1776aab 100755 --- a/btrbk +++ b/btrbk @@ -1917,7 +1917,7 @@ sub get_receive_targets_fsroot($$@) WARN "Receive target of \"$src_vol->{PRINT}\" exists at unexpected location: $text"; } } - return \@unexpected; + return @unexpected; } @@ -2678,12 +2678,11 @@ sub macro_archive_target($$$;$) }; } - # this is a bit harsh, disabled for now - # if(scalar(@unexpected_location) { - # ABORTED($droot, "Receive targets of archive candidates exist at unexpected location"); - # WARN "Skipping archiving of \"$sroot->{PRINT}/${snapshot_name}.*\": $abrt"; - # return undef; - # } + if(scalar(@unexpected_location)) { + ABORTED($droot, "Receive targets of archive candidates exist at unexpected location"); + WARN "Skipping archiving of \"$sroot->{PRINT}/${snapshot_name}.*\": $abrt"; + return undef; + } # add all present archives as informative_only: these are needed for correct results of schedule() foreach my $dvol (@{vinfo_subvol_list($droot)})