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 => {
|
||||
'Readonly' => 0,
|
||||
'Digest::SHA1' => 0,
|
||||
'Config::YAML' => 0,
|
||||
},
|
||||
script_files => [
|
||||
'scripts/da',
|
||||
|
|
|
@ -11,6 +11,7 @@ use List::Util qw(min);
|
|||
use IO::Handle;
|
||||
use Simba::Util qw(quote unquote typestr);
|
||||
use POSIX qw(strftime);
|
||||
use Config::YAML;
|
||||
|
||||
Readonly my $BUFSIZE => 128 * 1024;
|
||||
#my $BUFSIZE = 128 * 1024;
|
||||
|
@ -35,15 +36,22 @@ sub new {
|
|||
# * Other system dependent parameters, e.g., whether to use ACLs
|
||||
#
|
||||
# For now we just hardcode the stuff:
|
||||
|
||||
$self->{prune} = {
|
||||
# directories to prune. These are relative
|
||||
# paths which may not be ideal.
|
||||
'./proc' => 1,
|
||||
'./sys' => 1,
|
||||
'./nfs' => 1,
|
||||
'./backup' => 1,
|
||||
};
|
||||
my $config = Config::YAML->new( config => '/etc/simba/ca.conf');
|
||||
if ($config->{prune}) {
|
||||
for (@{ $config->{prune} }) {
|
||||
$_ = ".$_" if (m{^/});
|
||||
$self->{prune}{$_} = 1;
|
||||
}
|
||||
} else {
|
||||
$self->{prune} = {
|
||||
# directories to prune. These are relative
|
||||
# paths which may not be ideal.
|
||||
'./proc' => 1,
|
||||
'./sys' => 1,
|
||||
'./nfs' => 1,
|
||||
'./backup' => 1,
|
||||
};
|
||||
}
|
||||
$self->{charset} = 'utf-8';
|
||||
$self->{fh_out} = exists($opt->{fh_out}) ? $opt->{fh_out} : \*STDOUT;
|
||||
$self->{fh_log} = exists($opt->{fh_log}) ? $opt->{fh_log} : \*STDERR;
|
||||
|
|
Loading…
Reference in New Issue