From f8ef39ae0fa913e2922e167a01af24e8a6fbf1f0 Mon Sep 17 00:00:00 2001 From: hjp Date: Wed, 8 Jun 2016 19:48:33 +0000 Subject: [PATCH] Add column active to mark filesets which should be backed up. This can still be overridden with the filesets option. --- doc/schema.mysql | 1 + doc/schema.pgsql | 3 ++- lib/Simba/CA.pm | 7 +++++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/doc/schema.mysql b/doc/schema.mysql index 379395e..09ab2a4 100644 --- a/doc/schema.mysql +++ b/doc/schema.mysql @@ -60,6 +60,7 @@ CREATE TABLE `filesets` ( `host` varchar(255) default NULL, `dir` text, `options` text, + active tinyint not null default 1, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; SET character_set_client = @saved_cs_client; diff --git a/doc/schema.pgsql b/doc/schema.pgsql index 6c04f59..de6b60f 100644 --- a/doc/schema.pgsql +++ b/doc/schema.pgsql @@ -9,7 +9,8 @@ create table filesets ( id serial primary key, host varchar, dir varchar, - options varchar + options varchar, + active boolean not null default 't' ); create table files ( diff --git a/lib/Simba/CA.pm b/lib/Simba/CA.pm index 2ad0c9a..f406de4 100644 --- a/lib/Simba/CA.pm +++ b/lib/Simba/CA.pm @@ -121,6 +121,13 @@ sub new { grep { $id == $_ } @{ $opt->{filesets} } } @{ $self->{targets} } ]; + } else { + $self->{targets} = + [ + grep { + $_->{active}; + } @{ $self->{targets} } + ]; } if ($ENV{HOME} =~ m{([/\w]*)}) { if (-f "$1/.ssh/id_rsa") {