From d0ba0bc284bb92a8f0e63cfbd773e8c61e175973 Mon Sep 17 00:00:00 2001 From: Attie Grande Date: Mon, 6 Aug 2018 14:16:25 +0100 Subject: [PATCH] handled empty syncoid:sync property - behaves like unset --- README.md | 4 +++- syncoid | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8c05fb3..b833dec 100644 --- a/README.md +++ b/README.md @@ -140,7 +140,9 @@ As of 1.4.18, syncoid also automatically supports and enables resume of interrup _Note_: this will also prevent syncoid from handling the dataset if given explicitly on the command line. - _Note_: syncing a child of a no-sync dataset will currently result in a critical error + _Note_: syncing a child of a no-sync dataset will currently result in a critical error. + + _Note_: empty properties will be handled as if they were unset. ##### Syncoid Command Line Options diff --git a/syncoid b/syncoid index 7877723..fa00751 100755 --- a/syncoid +++ b/syncoid @@ -185,7 +185,8 @@ sub syncdataset { my $sync = getzfsvalue($sourcehost,$sourcefs,$sourceisroot,'syncoid:sync'); - if ($sync eq 'true' || $sync eq '-') { + if ($sync eq 'true' || $sync eq '-' || $sync eq '') { + # empty is handled the same as unset (aka: '-') # definitely sync this dataset - if a host is called 'true' or '-', then you're special } elsif ($sync eq 'false') { if (!$quiet) { print "INFO: Skipping dataset (syncoid:sync=false): $sourcefs...\n"; }