Commit | Line | Data |
---|---|---|
f8beb284 MW |
1 | .TH ezmlm-tstdig 1 |
2 | .SH NAME | |
3 | ezmlm-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 | |
19 | reads files in the list directory | |
20 | .I dir | |
21 | and determines if any of the criteria specified by the options are met. | |
22 | If they are, or if all options specified are 0, | |
23 | .B ezmlm-tstdig | |
24 | exits with success (0). Otherwise, | |
25 | .B ezmlm-tstdig | |
26 | exits (99), or in case of errors, (100) for permanent and (111) for temporary | |
27 | errors. | |
28 | ||
29 | The normal use of | |
30 | .B ezmlm-tstdig | |
31 | is to place it in a script so that | |
32 | .B ezmlm-get(1) | |
33 | is executed if | |
34 | .B ezmlm-tstdig | |
35 | exists 0, but skipped otherwise. | |
36 | ||
37 | .B ezmlm-tstdig | |
38 | uses LOCAL to adapt its behavior so that it | |
39 | can be used from the command line, a script, or from within | |
40 | .IR dir\fB/editor , | |
41 | or | |
42 | .IR dir\fB/manager . | |
43 | If invoked from | |
44 | .IR dir\fB/editor , | |
45 | the | |
46 | .B ezmlm-tstdig | |
47 | line should end in '|| exit 99'. | |
48 | When used here, | |
49 | .B ezmlm-tstdig | |
50 | if digest generation criteria are met | |
51 | tests a | |
52 | timestamp in | |
53 | .IR dir\fB/tstdig . | |
54 | If | |
55 | .I dir\fB/tstdig | |
56 | is more than 1 hour old or a digest has been successfully created since | |
57 | .I dir\fB/tstdig | |
58 | was written, | |
59 | .B ezmlm-tstdig | |
60 | will set the timestamp to the current time and exit 0. Otherwise it will | |
61 | exit 99. This is to guard against initiating duplicate digests when messages | |
62 | arrive while digesting is in progress. | |
63 | .SH OPTIONS | |
64 | .TP | |
65 | .B \-k | |
66 | Success if more than | |
67 | .I kbytes | |
68 | of message body has accumulated since the latest digest. | |
69 | .TP | |
70 | .B \-m | |
71 | Success if more than | |
72 | .I msg | |
73 | messages have accumulated since the latest digest. | |
74 | .TP | |
75 | .B \-t | |
76 | Success if more than | |
77 | .I time | |
78 | hours have passed since the latest digest. | |
79 | .SH USAGE | |
80 | This 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 | |
91 | EZPATH='/usr/local/bin/ezmlm' | |
92 | ||
93 | EZTST="${EZPATH}/ezmlm-tstdig" | |
94 | EZGET="${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 | |
102 | Obviously, | |
103 | .B ezmlm-tstdig | |
104 | should be integrated into the digesting program so that | |
105 | .I dir\fB/tstdig | |
106 | will not be not necessary. This may be done in the next version. | |
107 | .SH "SEE ALSO" | |
108 | ezmlm-get(1), | |
109 | ezmlm-make(1), | |
110 | ezmlm-manage(1), | |
111 | ezmlm-send(1), | |
112 | ezmlm(5) |