added in 'du.pm' the new 'extra_args' option to be able to include extra arguments to the 'du' command

This commit is contained in:
Jordi Sanfeliu 2015-12-23 16:42:26 +01:00
parent 3690b04aac
commit 67fa4cc63b
1 changed files with 2 additions and 1 deletions

View File

@ -132,6 +132,7 @@ sub du_update {
my ($package, $config, $debug) = @_;
my $rrd = $config->{base_lib} . $package . ".rrd";
my $du = $config->{du};
my $args = $du->{extra_args} || "";
my $seek_pos;
my $logsize;
@ -150,7 +151,7 @@ sub du_update {
$dirs[$e][$e2] = 0 unless defined $dirs[$e][$e2];
$str = trim($i);
if(-d $str) {
$line = `du -ks "$str"`; # in KB
$line = `du -ks $args "$str"`; # in KB
if($line =~ /(^\d+)\s+/) {
$dirs[$e][$e2] = $1;
}