error out if no datasets are processed with recursive arg

This commit is contained in:
Christoph Klaffl 2019-01-25 23:58:12 +01:00
parent 85561ddcda
commit 132c765e28
No known key found for this signature in database
GPG Key ID: FC1C525C2A47CC28
1 changed files with 6 additions and 0 deletions

View File

@ -124,6 +124,12 @@ if (!defined $args{'recursive'}) {
if ($debug) { print "DEBUG: recursive sync of $sourcefs.\n"; }
my @datasets = getchilddatasets($sourcehost, $sourcefs, $sourceisroot);
if (!@datasets) {
warn "CRITICAL ERROR: no datasets found";
@datasets = ();
$exitcode = 2;
}
my @deferred;
foreach my $datasetProperties(@datasets) {