1.2.0 - added monitor-children-only parameter to sanoid.conf for cases where parent dataset is kept empty

This commit is contained in:
Jim Salter 2015-04-01 18:38:08 -04:00
parent 5bf101cc08
commit aa55a4ece0
5 changed files with 16 additions and 5 deletions

View File

@ -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

View File

@ -1 +1 @@
1.1.0
1.2.0

7
sanoid
View File

@ -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};
}

View File

@ -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.
#

View File

@ -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;