Import ezmlm-idx 0.40
[ezmlm] / ezmlm-tstdig.1
CommitLineData
f8beb284
MW
1.TH ezmlm-tstdig 1
2.SH NAME
3ezmlm-tstdig \- Tests if a digest should be created
4.SH SYNOPSIS
5.B ezmlm-tstdig
6[
7.B -k
8.I kbytes
9] [
10.B -m
11.I msg
12] [
13.B \-t
14.I time
15]
16.I dir
17
18.B ezmlm-tstdig
19reads files in the list directory
20.I dir
21and determines if any of the criteria specified by the options are met.
22If they are, or if all options specified are 0,
23.B ezmlm-tstdig
24exits with success (0). Otherwise,
25.B ezmlm-tstdig
26exits (99), or in case of errors, (100) for permanent and (111) for temporary
27errors.
28
29The normal use of
30.B ezmlm-tstdig
31is to place it in a script so that
32.B ezmlm-get(1)
33is executed if
34.B ezmlm-tstdig
35exists 0, but skipped otherwise.
36
37.B ezmlm-tstdig
38uses LOCAL to adapt its behavior so that it
39can be used from the command line, a script, or from within
40.IR dir\fB/editor ,
41or
42.IR dir\fB/manager .
43If invoked from
44.IR dir\fB/editor ,
45the
46.B ezmlm-tstdig
47line should end in '|| exit 99'.
48When used here,
49.B ezmlm-tstdig
50if digest generation criteria are met
51tests a
52timestamp in
53.IR dir\fB/tstdig .
54If
55.I dir\fB/tstdig
56is more than 1 hour old or a digest has been successfully created since
57.I dir\fB/tstdig
58was written,
59.B ezmlm-tstdig
60will set the timestamp to the current time and exit 0. Otherwise it will
61exit 99. This is to guard against initiating duplicate digests when messages
62arrive while digesting is in progress.
63.SH OPTIONS
64.TP
65.B \-k
66Success if more than
67.I kbytes
68of message body has accumulated since the latest digest.
69.TP
70.B \-m
71Success if more than
72.I msg
73messages have accumulated since the latest digest.
74.TP
75.B \-t
76Success if more than
77.I time
78hours have passed since the latest digest.
79.SH USAGE
80This is an example script for ezmlm-tstdig usage.
81
82.RS
83.nf
84#!/bin/sh
85#usage: script dir diglist@host
86#digest if > 64 kbytes message bodies,
87# > 30 messages, or
88# > 48 hours since last digest.
89
90# ezmlm bin path - modify for your setup
91EZPATH='/usr/local/bin/ezmlm'
92
93EZTST="${EZPATH}/ezmlm-tstdig"
94EZGET="${EZPATH}/ezmlm-get"
95${EZTST} -k64 -m30 -t48 "$1" || exit 0
96${EZGET} -t "'$2'" "'$1'" < /dev/null
97# improve by testing exit status
98.fi
99.RE
100.PP
101.SH BUGS
102Obviously,
103.B ezmlm-tstdig
104should be integrated into the digesting program so that
105.I dir\fB/tstdig
106will not be not necessary. This may be done in the next version.
107.SH "SEE ALSO"
108ezmlm-get(1),
109ezmlm-make(1),
110ezmlm-manage(1),
111ezmlm-send(1),
112ezmlm(5)