[Logwatch] Temp File Question

Mike Tremaine mgt at stellarcore.net
Tue May 10 13:37:10 MST 2005

On Tue, 2005-05-10 at 13:27, Edgar Kaldahl wrote:
> Just wondering but where does logwatch put it's temp files?  I keep
> seeing the following in the root dir and was wondering if this is done
> by logwatch.pl? (logwatch.v17MW61G) I'm having a problem with disk space
> on and old machine.  That directory is filling up the root partition and
> then I don't get the reports and a bunch of other problems.  So is it
> enough for me to change line 520 of the logwatch script to something
> like.
> my $TempDir = mkdtemp('/newdrive/logwatch.XXXXXXXX');
> Will this work or are there other places that need to be looked at
> first?

Yes this was my bad, I think in 5.2 something I converted to use
File::Temp and tried to keep the it sort of the same. The mistake was it
creates the temp directory where ever it is called from [in this case /
from cron]

This is fixed in the 6.0.2 release [I think somewhere around there].

It is line 540 now in logwatch.pl it should look like this

#Making temp dir with File::Temp  -mgt
my $TempDir = tempdir( 'logwatch.XXXXXXXX', DIR => $Config{tmpdir},
      CLEANUP => 0 );

That will allow you to put it where you want.

Mike Tremaine
mgt at stellarcore.net

More information about the Logwatch mailing list