From ee03da2f9b44401fff02851780493b30abfb0b39 Mon Sep 17 00:00:00 2001 From: Edwin Eefting Date: Sun, 15 Mar 2020 22:54:14 +0100 Subject: [PATCH] exposed --min-change value as a parameter. (was hardcoded at 200000) --- bin/zfs-autobackup | 56 +++++++++++++++++++++++++++++----------------- 1 file changed, 35 insertions(+), 21 deletions(-) diff --git a/bin/zfs-autobackup b/bin/zfs-autobackup index d80c991..aa88600 100755 --- a/bin/zfs-autobackup +++ b/bin/zfs-autobackup @@ -498,7 +498,6 @@ class ZfsDataset(): 'volume': [ "canmount" ], } - ZFS_MAX_UNCHANGED_BYTES=200000 def __init__(self, zfs_node, name, force_exists=None): """name: full path of the zfs dataset @@ -691,12 +690,14 @@ class ZfsDataset(): return(ret) - def is_changed(self): + def is_changed(self, min_changed_bytes=1): """dataset is changed since ANY latest snapshot ?""" self.debug("Checking if dataset is changed") - #NOTE: filesystems can have a very small amount written without actual changes in some cases - if int(self.properties['written'])<=self.ZFS_MAX_UNCHANGED_BYTES: + if min_changed_bytes==0: + return(True) + + if int(self.properties['written'])