Add '--no-oldfiles-log' option that suppresses a warning about old files in the logwatch temporary directory. Author: Ivana Varekova RH-Bugzilla: #230974 Backported-By: Jan Synacek --- logwatch-svn198/logwatch.8 2014-01-26 13:46:02.000000000 +0100 +++ logwatch-svn198/logwatch.8 2014-07-04 10:03:26.870415276 +0200 @@ -35,7 +35,7 @@ .I report format .B ] [--encode .I encoding to use -.B ] [--numeric] [--version] [--help|--usage] +.B ] [--numeric] [--no-oldfiles-log] [--version] [--help|--usage] .SH DESCRIPTION .B Logwatch is a customizable, pluggable log-monitoring system. It will go @@ -111,6 +111,9 @@ Number of characters that html output should be wrapped to. Default is 80. .IP "\fB--numeric\fR" Inhibits additional name lookups, displaying IP addresses numerically. +.IP "\fB--no-oldfiles-log\fR" +Suppress the logwatch log, which informs about the +old files in logwatch tmpdir. .IP "\fB--usage\fR" Displays usage information .IP "\fB--help\fR" --- logwatch-svn198/scripts/logwatch.pl 2014-07-04 10:02:23.930302006 +0200 +++ logwatch-svn198/scripts/logwatch.pl 2014-07-04 10:05:01.588585717 +0200 @@ -187,6 +187,7 @@ my @TempServiceList = (); my $Help = 0; my $ShowVersion = 0; +my $NoOldfilesLog = 0; my ($tmp_mailto, $tmp_savefile); &GetOptions ("d|detail=s" => \$Config{'detail'}, @@ -209,6 +210,7 @@ "hostformat=s" => \$Config{'hostformat'}, "hostlimit=s" => \$Config{'hostlimit'}, "html_wrap=s" => \$Config{'html_wrap'}, + "no-oldfiles-log" => \$NoOldfilesLog, "subject=s" => \$Config{'subject'} ) or &Usage(); @@ -632,7 +634,7 @@ opendir(TMPDIR, $Config{'tmpdir'}) or die "$Config{'tmpdir'} $!"; my @old_dirs = grep { /^logwatch\.\w{8}$/ && -d "$Config{'tmpdir'}/$_" } readdir(TMPDIR); -if (@old_dirs) { +if ((@old_dirs) && ($NoOldfilesLog==0)) { print "You have old files in your logwatch tmpdir ($Config{'tmpdir'}):\n\t"; print join("\n\t", @old_dirs); print "\nThe directories listed above were most likely created by a\n"; @@ -1085,7 +1087,7 @@ sub Usage () { # Show usage for this program print "\nUsage: $0 [--detail ] [--logfile ] [--output ]\n" . - " [--format ] [--encode ] [--numeric]\n" . + " [--format ] [--encode ] [--numeric] [--no-oldfiles-log]\n" . " [--mailto ] [--archives] [--range ] [--debug ]\n" . " [--filename ] [--help|--usage] [--version] [--service ]\n" . " [--hostformat ] [--hostlimit ] [--html_wrap ]\n\n"; @@ -1096,6 +1098,8 @@ print "--output : Report Output - stdout [default], mail, file.\n"; #8.0 print "--format : Report Format - text [default], html.\n"; #8.0 print "--encode : Enconding to use - none [default], base64.\n"; #8.0 + print "--no-oldfiles-log: Suppress the logwatch log, which informs about the\n"; + print " old files in logwatch tmpdir.\n"; print "--mailto : Mail report to .\n"; print "--archives: Use archived log files too.\n"; print "--filename : Used to specify they filename to save to. --filename [Forces output to file].\n";