My comment applies exactly to from the current git, and the code I pasted above is still in https://sourceforge.net/p/logwatch/git/ci/master/tree/scripts/services/zz-disk_space (which you could have checked?) Here it is again: sub DirUsage { my $Dir = $_[0]; if ( !-d $Dir ) { print STDERR "Directory $Dir not found\n"; return }; DirUsage is being called with DirUsage($Dir.'/*'); and configured for the $Dir at this point of calling is "/home" so in the sub DirUsage my $Dir = "/home/*"; $ perl -e '$Dir...
My comment applies exactly to from the current git, and the code I pasted above is still in https://sourceforge.net/p/logwatch/git/ci/master/tree/scripts/services/zz-disk_space (which you could have checked?) Here it is again: sub DirUsage { my $Dir = $_[0]; if ( !-d $Dir ) { print STDERR "Directory $Dir not found\n"; return }; DirUsage is being called with DirUsage($Dir.'/*'); and configured for the $Dir at this point of calling is "/home" so in the sub DirUsage my $Dir = "/home/*"; $ perl -e '$Dir...
The mistake is, that you are adding * for globbing, but then treating e.g. /home/* itself as a direcotry name without using globbing. But the directory /home/* doesn't exist. You cannot do something lie opendir DIR, "$Dir", because /home/* itself is not a directory. You either have to not add the * here: sub DirectorySizes { my $Dir = $_[0]; DirUsage($Dir.'/*'); } or do something like sub DirUsage { my $Dir = $_[0]; while ($Dir = glob($Dir)){ if ( !-d $Dir ) { print "Directory $Dir not found\n";...
The mistake is, that you are adding * for globbing, but then treating e.g. /home/* itself as a direcotry name without using globbing. But the directory /home/* doesn't exist. You cannot do something lie opendir DIR, "$Dir", because /home/* itself is not a directory. You either have to not add the * here: sub DirectorySizes { |-------my $Dir = $_[0]; |-------DirUsage($Dir.'/*'); } or do something like sub DirUsage { my $Dir = $_[0]; while ($Dir = glob($Dir)){ if ( !-d $Dir ) { print "Directory $Dir...