diff --git a/bin/zfs-autobackup b/bin/zfs-autobackup index 8b2c457..79da5df 100755 --- a/bin/zfs-autobackup +++ b/bin/zfs-autobackup @@ -990,7 +990,7 @@ class ZfsDataset(): #verbose output cmd.append("-v") - if 'extensible_dataset' in features: + if 'extensible_dataset' in features and "-s" in self.zfs_node.supported_recv_options: #support resuming self.debug("Enabled resume support") cmd.append("-s") @@ -1355,6 +1355,17 @@ class ZfsNode(ExecuteNode): ret.append(option) return(ret) + @cached_property + def supported_recv_options(self): + """list of supported options""" + #not every zfs implementation supports them all + + ret=[] + for option in ["-s" ]: + if self.valid_command(["zfs","recv", option, "zfs_autobackup_option_test"]): + ret.append(option) + return(ret) + def valid_command(self, cmd): """test if a specified zfs options are valid exit code. use this to determine support options"""