INN commit: trunk (backends/sendinpaths.in doc/pod/ninpaths.pod)
INN Commit
rra at isc.org
Sun Jul 24 14:37:06 UTC 2011
Date: Sunday, July 24, 2011 @ 07:37:06
Author: iulius
Revision: 9289
sendinpaths: add a pattern for the dump filenames
Only process files whose name begin with "inpaths." for legacy reasons
(behaviour of the previous sendinpaths shell script). It will prevent
issues on <pathlog>/path being symlinked to another directory.
Also abort the run of sendinpaths if we cannot chdir() to the log directory.
Thanks to The Doctor for having reported the problem.
Modified:
trunk/backends/sendinpaths.in
trunk/doc/pod/ninpaths.pod
-------------------------+
backends/sendinpaths.in | 8 +++++---
doc/pod/ninpaths.pod | 4 ++++
2 files changed, 9 insertions(+), 3 deletions(-)
Modified: backends/sendinpaths.in
===================================================================
--- backends/sendinpaths.in 2011-07-22 23:08:57 UTC (rev 9288)
+++ backends/sendinpaths.in 2011-07-24 14:37:06 UTC (rev 9289)
@@ -10,6 +10,7 @@
##
## Prerequisites:
## The ninpaths dump files are in the ${INN::Config::pathlog}/path directory.
+## The ninpaths dump filenames begin with "inpaths.".
## The ninpaths program is installed in ${INN::Config::pathbin}.
use strict;
@@ -85,11 +86,12 @@
@files = readdir($DIR);
closedir($DIR);
- chdir($ninpathsdir);
+ chdir($ninpathsdir) || die "cannot chdir $ninpathsdir: $!\n";
foreach my $file (@files) {
- # Process only files.
+ # Process only inpaths files.
next if (! -f $file);
+ next if ($file !~ /^inpaths\./);
# Get a listing of all the wanted files to process.
# -s for nonzero size, -M for last modification age in days.
@@ -97,7 +99,7 @@
push @validfiles, $file;
}
- # Now get the listing of allthe files that will be removed.
+ # Now get the listing of all the files that will be removed.
if (int(-M $file) >= $keepdays) {
push @oldfiles, $file;
}
Modified: doc/pod/ninpaths.pod
===================================================================
--- doc/pod/ninpaths.pod 2011-07-22 23:08:57 UTC (rev 9288)
+++ doc/pod/ninpaths.pod 2011-07-24 14:37:06 UTC (rev 9289)
@@ -46,6 +46,10 @@
<pathbin> with the full path to your INN binaries directory, and
<pathlog> with the full path to your INN log directory.
+Note that the naming convention of the generated inpaths dump files should
+not be changed. B<sendinpaths> explicitly searches files whose name starts
+with C<inpaths.> in the <pathlog>/path directory.
+
=item 3.
Run the following command to start logging these statistics:
More information about the inn-committers
mailing list