diff --git a/bundles/zfs/files/zfs-auto-snapshot b/bundles/zfs/files/zfs-auto-snapshot index a085ea3..e50514e 100644 --- a/bundles/zfs/files/zfs-auto-snapshot +++ b/bundles/zfs/files/zfs-auto-snapshot @@ -31,8 +31,15 @@ label = argv[1] with open('/etc/zfs-snapshot-config.json', 'r') as fp: metadata = loads(fp.read()) -output = check_output(['zfs', 'list', '-H', '-o', 'name']).decode('UTF-8') -datasets = set(output.splitlines()) +datasets = set() +for line in check_output(['zfs', 'list', '-H', '-o', 'name']).splitlines(): + line = line.decode('UTF-8') + + for prefix in metadata.get('snapshot_never', set()): + if dataset.startswith(prefix): + break + else: + datasets.add(line) default_retain = metadata['retain_defaults'][label] now = datetime.now().strftime('%F-%H%M')