File: ninpaths.README

package info (click to toggle)
ninpaths 1.5-2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 64 kB
  • ctags: 37
  • sloc: ansic: 400; sh: 38; makefile: 34
file content (55 lines) | stat: -rw-r--r-- 2,381 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
This is an efficient and space-saving inpaths reporting program.
It works as follows: you feed it the Path lines via an INN channel
feed, and from time to time the program writes all its internal
counters accumulated so far to a dump file. Another instance of the
program picks up all the dump files, adds them up and formats them
into the report.

A working setup goes as follows:
0. Make a directory MOST_LOGS/path
1. Make a channel feed like
   !inpaths::Tc,WP:/var/lib/news/localbin/ninpaths -p\
         -d MOST_LOGS/path/inpaths.%d
   if your INN supports WP, else see below.
2. Enter in your crontab:
   6 6 * * * ctlinnd flush !inpaths
   (the actual time doesn't matter)
   This will generate the dump files, one a day.
3. Once a month run the "sendinpaths" script, which collects the dumps,
   makes a report and deletes old dumps.
   (You can generate a report without mailing it and without deleting
   any old files with "sendinpaths -n".)

On my small test box, where the collected Path lines from the older
inpaths accumulated about 4MB daily, the daily dump file runs around
50-100k. The program is fast; writing the dump doesn't take more than
a few seconds, preparing a report a bit more.

ninpaths takes the following parameters:
-p      Read Path lines from standard input.
-d file Dump data to file. A "%d" in the file name will be replaced by
        the current system time when the dump proceeds.
-u file Read a dump file.
        The "-u file" argument can be repeated to collect several dumps.
-r site Produce a report for "site".
-v n    Set report verbosity (n=0,1,2; default=2).
No check is made (by now) whether the given arguments make any sense.

If your INN doesn't have the WP feed flag (1.5 has not, 1.6 has, 1.7
I don't know, 2.0 has) use the following:
   !inpaths::Tc,WH:/var/lib/news/localbin/ginpaths
where "ginpaths" is the following script:
#!/bin/sh
exec egrep '^Path: ' | ninpaths -p -d MOST_LOGS/path/inpaths.%d

(of course, replace MOST_LOGS with the right directory in all of the above)

The idea and some implementation details for ninpaths come from the
original inpaths program, but most of the code has been rewritten for
clarity.

This program is posted to alt.sources and kept on my WWW archive under
<http://sites.inka.de/~bigred/sw/>.

Olaf Titz <olaf@bigred.inka.de>
$Id: ninpaths.README,v 1.4 1998/06/28 13:41:06 olaf Exp $