Skip to content

Commit

Permalink
1.2.0 - added monitor-children-only parameter to sanoid.conf for case…
Browse files Browse the repository at this point in the history
…s where parent dataset is kept empty
  • Loading branch information
jimsalterjrs committed Apr 1, 2015
1 parent 5bf101c commit aa55a4e
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 5 deletions.
2 changes: 2 additions & 0 deletions 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
Expand Down
2 changes: 1 addition & 1 deletion VERSION
@@ -1 +1 @@
1.1.0
1.2.0
7 changes: 4 additions & 3 deletions sanoid
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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");

Expand Down Expand Up @@ -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};
}
Expand Down
8 changes: 8 additions & 0 deletions sanoid.defaults.conf
Expand Up @@ -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.
#
Expand Down
2 changes: 1 addition & 1 deletion syncoid
Expand Up @@ -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;
Expand Down

0 comments on commit aa55a4e

Please sign in to comment.