From aa55a4ece09743fd808eb0ff8d7cb0c405aa9ea7 Mon Sep 17 00:00:00 2001 From: Jim Salter Date: Wed, 1 Apr 2015 18:38:08 -0400 Subject: [PATCH] 1.2.0 - added monitor-children-only parameter to sanoid.conf for cases where parent dataset is kept empty --- CHANGELIST | 2 ++ VERSION | 2 +- sanoid | 7 ++++--- sanoid.defaults.conf | 8 ++++++++ syncoid | 2 +- 5 files changed, 16 insertions(+), 5 deletions(-) diff --git a/CHANGELIST b/CHANGELIST index 20c4aa1..ad5bf90 100644 --- a/CHANGELIST +++ b/CHANGELIST @@ -1,3 +1,5 @@ +1.2.0 added monitor-children-only parameter to sanoid.conf for use with recursive definitions - in cases where container dataset is kept empty + 1.1.0 woooo - working recursive definitions in Sanoid! Also intelligent config errors in Sanoid; will die with errors if unknown config value is set. 1.0.20 greatly cleaned up config parsing in sanoid, got rid of 'hardcoded defaults' in favor of /etc/sanoid/sanoid.defaults.conf diff --git a/VERSION b/VERSION index 9084fa2..26aaba0 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.1.0 +1.2.0 diff --git a/sanoid b/sanoid index 0866f04..e50314f 100755 --- a/sanoid +++ b/sanoid @@ -4,7 +4,7 @@ # from http://www.gnu.org/licenses/gpl-3.0.html on 2014-11-17. A copy should also be available in this # project's Git repository at https://github.com/jimsalterjrs/sanoid/blob/master/LICENSE. -my $version = '1.1.0'; +my $version = '1.2.0'; use strict; use Config::IniFiles; # read samba-style conf file @@ -106,6 +106,7 @@ sub monitor_snapshots() { foreach my $section (keys %config) { if ($section =~ /^template/) { next; } if (! $config{$section}{'monitor'}) { next; } + if ($config{$section}{'monitor_children_only'}) { next; } my $path = $config{$section}{'path'}; push @paths, $path; @@ -530,7 +531,7 @@ sub init { tie my %ini, 'Config::IniFiles', ( -file => $conf_file ) or die "FATAL: cannot load $conf_file - please create a valid local config file before running sanoid!"; # we'll use these later to normalize potentially true and false values on any toggle keys - my @toggles = ('autosnap','autoprune','monitor_dont_warn','monitor_dont_crit','monitor','recursive'); + my @toggles = ('autosnap','autoprune','monitor_dont_warn','monitor_dont_crit','monitor','recursive','monitor_children_only'); my @istrue=(1,"true","True","TRUE","yes","Yes","YES","on","On","ON"); my @isfalse=(0,"false","False","FALSE","no","No","NO","off","Off","OFF"); @@ -614,7 +615,7 @@ sub init { foreach my $dataset(@datasets) { chomp $dataset; foreach my $key (keys %{$config{$section}} ) { - if (! ($key =~ /template|recursive/)) { + if (! ($key =~ /template|recursive|monitor_children_only/)) { if ($args{'debug'}) { print "DEBUG: recursively setting $key from $section to $dataset.\n"; } $config{$dataset}{$key} = $config{$section}{$key}; } diff --git a/sanoid.defaults.conf b/sanoid.defaults.conf index e13d433..4b49d09 100644 --- a/sanoid.defaults.conf +++ b/sanoid.defaults.conf @@ -8,6 +8,14 @@ [template_default] +# these settings don't make sense in a template, but we use the defaults file +# as our list of allowable settings also, so they need to be present here even if +# unset. +path = +recursive = +use_template = +monitor_children_only = + # If any snapshot type is set to 0, we will not take snapshots for it - and will immediately # prune any of those type snapshots already present. # diff --git a/syncoid b/syncoid index 2612d3b..24c6039 100755 --- a/syncoid +++ b/syncoid @@ -4,7 +4,7 @@ # from http://www.gnu.org/licenses/gpl-3.0.html on 2014-11-17. A copy should also be available in this # project's Git repository at https://github.com/jimsalterjrs/sanoid/blob/master/LICENSE. -my $version = '1.1.0'; +my $version = '1.2.0'; use strict; use Data::Dumper;