chiark / gitweb /
use libinn logging where applicable - debugged
[inn-innduct.git] / doc / pod / tdx-util.pod
1 =head1 NAME
2
3 tdx-util - Tradindexed overview manipulation utility
4
5 =head1 SYNOPSIS
6
7 B<tdx-util> [B<-AFgio>] [B<-a> I<article>] [B<-n> I<newsgroup>]
8 [B<-p> I<path>] [B<-R> I<path>]
9
10 =head1 DESCRIPTION
11
12 B<tdx-util> is an administrative interface to the tradindexed overview
13 method for INN.  It only works on tradindexed overview databases, not on
14 any other type of INN overview.  It allows the administrator to dump
15 various information about the internal state of the overview, audit it for
16 errors, and rebuild portions of the overview database.
17
18 The tradindexed overview method should lock properly and therefore it
19 should be safe to run this utility and perform any operation it performs,
20 including full repairs or per-group overview rebuilds, while the server is
21 running.  However, note that some of the operations performed by this
22 utility can take an extended period of time and will hold locks in the
23 overview database during that period, which depending on what the server
24 is doing may cause the server to stall until B<tdx-util> completes its
25 operation.
26
27 The dump operations are B<-i>, which dumps the master index for the
28 overview database, B<-g>, which dumps the index for an individual group,
29 and B<-o>, which dumps the overview information for a particular group
30 (including the additional metadata stored in the index).  For B<-g> and
31 B<-o>, the B<-n> option must also be given to specify a newsgroup to
32 operate on.
33
34 To audit the entire overview database for problems, use B<-A>.  Any
35 problems found will be reported to standard error.  There is not (yet) a
36 corresponding option to correct the errors found.
37
38 To rebuild the database for a particular newsgroup, use B<-R>.  The B<-R>
39 option takes a path to a directory which contains all of the articles for
40 that newsgroup, one per file.  The names of the files must be the numbers
41 of the articles in that group.  (In other words, this directory must be a
42 traditional spool directory for that group.)  The B<-n> option must also
43 be given to specify the newsgroup for which the overview is being rebuilt.
44
45 For all operations performed by B<tdx-util>, a different overview database
46 than the one specified in F<inn.conf> may be specified using the B<-p>
47 option.
48
49 =head1 OPTIONS
50
51 =over 4
52
53 =item B<-A>
54
55 Audit the entire overview database for problems.  This runs the internal
56 consistency checks built into the tradindexed overview implementation,
57 checking such things as the validity and reachability of all group index
58 entries, the format of the individual overview entries, the correspondance
59 of index entries to overview data, and similar such things.  No changes
60 will be made to the database, but problems will be reported to standard
61 error.
62
63 =item B<-a> I<article>
64
65 The article number to act on.  Only useful in combination with the B<-o>
66 option to dump overview information.
67
68 =item B<-F>
69
70 Audit the entire overview database for problems, fixing them as they're
71 detected where possible. This runs the internal consistency checks built
72 into the tradindexed overview implementation, checking such things as the
73 validity and reachability of all group index entries, the format of the
74 individual overview entries, the correspondance of index entries to
75 overview data, and similar such things.  The strategy used when fixing
76 problems is to throw away data that's unrecoverable, so be warned that
77 using this option may result in inaccessible articles if their overview
78 data has been corrupted.
79
80 To see what would be changed by B<-F>, run B<tdx-util> with B<-A> first.
81
82 =item B<-g>
83
84 Dump the master index of the overview database.  This contains similar
85 information to the server active file, such as high and low water marks
86 and moderation status, and is the information that nnrpd hands out to
87 clients.
88
89 The fields are, in order, the newsgroup name, the high water mark, the low
90 water mark, the base article number (the point at which the group index
91 begins), the count of articles in the group, the group status flag, the
92 time (in seconds since epoch) when that newsgroup was deleted or 0 if it
93 hasn't been, and the inode of the index file for that group.
94
95 =item B<-i>
96
97 Dump the index of a particular group.  The fields are, in order, the
98 article number, the offset of the data for that article in the overview
99 data file for that group, the length of the overview data, the time (in
100 seconds since epoch) when the article arrived on the server, the time (in
101 seconds since epoch) when the article should expire based on its Expires
102 header (or 0 if there is no Expires header), and the storage API token of
103 the article.
104
105 If this option is given, the B<-n> option must also be given to specify
106 the newsgroup on which to act.
107
108 =item B<-n> I<newsgroup>
109
110 Specify the newsgroup on which to act, required for the B<-i>, B<-o>, and
111 B<-R> options.
112
113 =item B<-o>
114
115 Dump the overview information for a newsgroup, in the same format as it
116 would be returned to clients but with one modification.  Appended to the
117 end of each entry will be four additional pieces of data:  the article
118 number according to the index file for that group, the storage API token
119 for that article, the arrival date for that article on the server in RFC
120 822 date format, and the expiration date for that article (from the
121 Expires header) in RFC 822 date format if there is any.
122
123 If this option is given, the B<-n> option must also be given to specify
124 the newsgroup on which to act.  By default, all of the overview
125 information for that newsgroup is dumped, but the B<-a> option may be
126 given to restrict the dump to the information for a single article.
127
128 =item B<-p> I<path>
129
130 Act on the overview database rooted in I<path>, overriding the overview
131 path specified in F<inn.conf>.
132
133 =item B<-R> I<path>
134
135 Rebuild the overview for a given group from the articles stored in
136 I<path>.  The articles must be in the form of a traditional spool
137 directory; in other words, each article must be in a separate file and the
138 name of the file must match the article number of the article.
139
140 If this option is given, the B<-n> option must also be given to specify
141 the newsgroup on which to act.
142
143 =back
144
145 =head1 EXAMPLES
146
147 Dump the master index for the overview database in F</news/overview>,
148 regardless of the overview path specified in F<inn.conf>:
149
150     tdx-util -i -p /news/overview
151
152 Dump the group index for example.test:
153
154     tdx-util -g -n example.test
155
156 Dump the complete overview information for example.test:
157
158     tdx-util -o -n example.test
159
160 Audit the entire overview database for any problems:
161
162     tdx-util -A
163
164 Rebuild the overview information for example.test from a traditional spool
165 directory:
166
167     tdx-util -R /news/spool/articles/example/test -n example.test
168
169 The last command may be useful for recovering from a bad crash or
170 corrupted overview information for a particular group, if you are also
171 using the tradspool article storage method.
172
173 =head1 HISTORY
174
175 Written by Russ Allbery <rra@stanford.edu> for InterNetNews.
176
177 $Id: tdx-util.pod 7047 2004-12-19 19:41:49Z rra $
178
179 =head1 SEE ALSO
180
181 makehistory(8)
182
183 =cut
184