Moved prune list of disk agent to a config file.
This commit is contained in:
parent
1546672d9a
commit
474ef9e7ef
1
Build.PL
1
Build.PL
|
@ -10,6 +10,7 @@ my $build = Simba::Build->new
|
||||||
requires => {
|
requires => {
|
||||||
'Readonly' => 0,
|
'Readonly' => 0,
|
||||||
'Digest::SHA1' => 0,
|
'Digest::SHA1' => 0,
|
||||||
|
'Config::YAML' => 0,
|
||||||
},
|
},
|
||||||
script_files => [
|
script_files => [
|
||||||
'scripts/da',
|
'scripts/da',
|
||||||
|
|
|
@ -11,6 +11,7 @@ use List::Util qw(min);
|
||||||
use IO::Handle;
|
use IO::Handle;
|
||||||
use Simba::Util qw(quote unquote typestr);
|
use Simba::Util qw(quote unquote typestr);
|
||||||
use POSIX qw(strftime);
|
use POSIX qw(strftime);
|
||||||
|
use Config::YAML;
|
||||||
|
|
||||||
Readonly my $BUFSIZE => 128 * 1024;
|
Readonly my $BUFSIZE => 128 * 1024;
|
||||||
#my $BUFSIZE = 128 * 1024;
|
#my $BUFSIZE = 128 * 1024;
|
||||||
|
@ -35,7 +36,13 @@ sub new {
|
||||||
# * Other system dependent parameters, e.g., whether to use ACLs
|
# * Other system dependent parameters, e.g., whether to use ACLs
|
||||||
#
|
#
|
||||||
# For now we just hardcode the stuff:
|
# For now we just hardcode the stuff:
|
||||||
|
my $config = Config::YAML->new( config => '/etc/simba/ca.conf');
|
||||||
|
if ($config->{prune}) {
|
||||||
|
for (@{ $config->{prune} }) {
|
||||||
|
$_ = ".$_" if (m{^/});
|
||||||
|
$self->{prune}{$_} = 1;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
$self->{prune} = {
|
$self->{prune} = {
|
||||||
# directories to prune. These are relative
|
# directories to prune. These are relative
|
||||||
# paths which may not be ideal.
|
# paths which may not be ideal.
|
||||||
|
@ -44,6 +51,7 @@ sub new {
|
||||||
'./nfs' => 1,
|
'./nfs' => 1,
|
||||||
'./backup' => 1,
|
'./backup' => 1,
|
||||||
};
|
};
|
||||||
|
}
|
||||||
$self->{charset} = 'utf-8';
|
$self->{charset} = 'utf-8';
|
||||||
$self->{fh_out} = exists($opt->{fh_out}) ? $opt->{fh_out} : \*STDOUT;
|
$self->{fh_out} = exists($opt->{fh_out}) ? $opt->{fh_out} : \*STDOUT;
|
||||||
$self->{fh_log} = exists($opt->{fh_log}) ? $opt->{fh_log} : \*STDERR;
|
$self->{fh_log} = exists($opt->{fh_log}) ? $opt->{fh_log} : \*STDERR;
|
||||||
|
|
Loading…
Reference in New Issue