1MAKEHISTORY(8) InterNetNews Documentation MAKEHISTORY(8)
2
3
4
6 makehistory - Initialize or rebuild INN history database
7
9 makehistory [-abFIOSx] [-f filename] [-l count] [-L load-average] [-s
10 size] [-T tmpdir]
11
13 makehistory rebuilds the history(5) text file, which contains a list of
14 message-IDs of articles already seen by the server. It can also be
15 used to rebuild the overview database. Note that even though the dbz
16 indices for the history file are also rebuilt by makehistory, it is
17 useful to run makedbz(8) after makehistory(8) in order to improve the
18 efficiency of the indices (makehistory does not know how large to make
19 the hash table at first run, unless the size is given by the -s flag).
20
21 The default location of the history text file is pathdb/history; to
22 specify an alternate location, use the -f flag.
23
24 By default, makehistory will scan the entire spool, using the storage
25 manager, and write a history line for every article. To also generate
26 overview information, use the -O flag.
27
29 WARNING: If you're trying to rebuild the overview database, be sure to
30 stop innd(8) and delete or zero out the existing database before you
31 start for the best results. An overview rebuild should not be done
32 while the server is running. Unless the existing overview is deleted,
33 you may end up with problems like out-of-order overview entries,
34 excessively large overview buffers, and the like.
35
36 If ovmethod in inn.conf is "ovdb", you must have the ovdb processes
37 running while rebuilding overview. ovdb needs them available while
38 writing overview entries. You can start them by hand separate from the
39 rest of the server by running ovdb_init; see ovdb_init(8) for more
40 details.
41
42 Similarly, if ovmethod in inn.conf is "ovsqlite", you must have the
43 ovsqlite-server process running while rebuilding overview. See
44 ovsqlite-server(8) for more details and how to start it by hand.
45
46 Rebuilding overview data is as straight-forward as:
47
48 1. Checking that the configuration file of the new overview storage
49 method is present in pathetc and fits your needs (buffindexed.conf,
50 ovdb.conf or ovsqlite.conf). Note that the tradindexed overview
51 storage method does not have a dedicated configuration file.
52
53 2. Making sure that INN is stopped ("rc.news stop" as the news user,
54 or whichever command you're using).
55
56 3. Setting the new overview storage method in the ovmethod parameter
57 in inn.conf.
58
59 4. Making sure that the directory specified by the pathoverview
60 parameter in inn.conf exists and is empty. Otherwise, rename the
61 current one (to backup existing overview data) and re-create
62 pathoverview as the news user.
63
64 5. Starting ovdb_init or ovsqlite-server as the news user if the new
65 overview storage method is respectively ovdb or ovsqlite.
66
67 6. Running "makehistory -O -x -F" and waiting for the command to
68 finish.
69
70 7. Stopping ovdb or ovsqlite helper programs if you started them
71 during the previous steps (running "rc.news stop" as the news user
72 will stop them; do not mind the messages related to the fact that
73 the news server was not running).
74
75 8. Starting INN and checking the logs to make sure everything is fine.
76 You will normally notice that the active file is renumbered
77 (rc.news takes care of that when run after an overview rebuild;
78 otherwise, manually run "ctlinnd renumber ''").
79
81 -a Append to the history file rather than generating a new one. If
82 you append to the main history file, make sure innd(8) is throttled
83 or not running, or you can corrupt the history.
84
85 -b Delete any messages found in the spool that do not have valid
86 Message-ID header fields in them.
87
88 -F Fork a separate process to flush overview data to disk rather than
89 doing it directly. The advantage of this is that it allows
90 makehistory to continue to collect more data from the spool while
91 the first batch of data is being written to the overview database.
92 The disadvantage is that up to twice as much temporary disk space
93 will be used for the generated overview data. This option only
94 makes sense in combination with -O. With buffindexed, the overchan
95 program is invoked to write overview.
96
97 -f filename
98 Rather than writing directly to pathdb/history, instead write to
99 filename, also in pathdb.
100
101 -I Don't store overview data for articles numbered lower than the
102 lowest article number in active. This is useful if there are for
103 whatever reason old articles on disk that shouldn't be available to
104 readers or put into the overview database.
105
106 -l count
107 This option specifies how many articles to process before writing
108 the accumulated overview information out to the overview database.
109 The default is 10000. Since overview write performance is faster
110 with sorted data, each "batch" gets sorted. Increasing the batch
111 size with this option may further improve write performance, at the
112 cost of longer sort times. Also, temporary space will be needed to
113 store the overview batches. At a rough estimate, about 300 * count
114 bytes of temporary space will be required (not counting temp files
115 created by sort(1)). See the description of the -T option for how
116 to specify the temporary storage location. This option has no
117 effect with buffindexed, because buffindexed does not need sorted
118 overview and no batching is done.
119
120 -L load-average
121 Temporarily pause activities if the system load average exceeds the
122 specified level load-average. This allows makehistory to run on a
123 system being used for other purposes without monopolizing system
124 resources and thus making the response time for other applications
125 unacceptably slow. Using nice(1) does not help much for that
126 because the problem comes from disk I/O usage, and ionice(1) is not
127 always available or efficient.
128
129 -O Create the overview database as well as the history file. Overview
130 information is only required if the server supports readers; it is
131 not needed for a transit-only server (see enableoverview in
132 inn.conf(5)). If you are using the buffindexed overview storage
133 method, erase all of your overview buffers before running
134 makehistory with -O.
135
136 -S Rather than storing the overview data into the overview database,
137 just write it to standard output in a form suitable for feeding to
138 overchan later if wished. When this option is used, -F, -I, -l,
139 and -T are ignored. This option only makes sense in combination
140 with -O.
141
142 -s size
143 Size the history database for approximately size pairs. Accurately
144 specifying the size is an optimization that will create a more
145 efficient database. (The size should be the estimated eventual
146 size of the history file, typically the size of the old file, in
147 lines.)
148
149 -T tmpdir
150 If -O is given, makehistory needs a location to write temporary
151 overview data. By default, it uses pathtmp, set in inn.conf, but
152 if this option is given, the provided tmpdir is used instead. This
153 is also used for temporary files created by sort(1) (which is
154 invoked in the process of writing overview information since sorted
155 overview information writes faster). By default, sort usually uses
156 your system temporary directory; see the sort(1) man page on your
157 system to be sure.
158
159 -x If this option is given, makehistory won't write out history file
160 entries. This is useful mostly for building overview without
161 generating a new history file.
162
164 Here's a typical example of rebuilding the entire history and overview
165 database, removing broken articles in the news spool. This uses the
166 default temporary file locations and should be done while innd isn't
167 running (or is throttled).
168
169 makehistory -b -f history.n -O -l 30000 -I
170
171 This will rebuild the overview (if using buffindexed, erase the
172 existing overview buffers before running this command) and leave a new
173 history file as "history.n" in pathdb. To preserve all of the history
174 entries from the old history file that correspond to rejected articles
175 or expired articles, follow the above command with:
176
177 cd <pathdb>
178 awk 'NF == 2 { print }' < history >> history.n
179
180 (replacing the path with your pathdb, if it isn't the default). Then
181 look over the new history file for problems and run:
182
183 makedbz -s `wc -l < history.n` -f history.n
184
185 Then rename all of the files matching "history.n.*" to "history.*",
186 replacing the current history database and indices. After that, it's
187 safe to unthrottle innd.
188
189 For a simpler example:
190
191 makehistory -b -f history.n -I -O
192
193 will scan the spool, removing broken articles and generating history
194 and overview entries for articles missing from history.
195
196 To just rebuild overview:
197
198 makehistory -O -x -F
199
201 pathdb/history
202 This is the default output file for makehistory.
203
204 pathtmp
205 Where temporary files are written unless -T is given.
206
208 Originally written by Rich $alz <rsalz@uunet.uu.net> for InterNetNews
209 and updated by various other people since.
210
212 active(5), ctlinnd(8), history(5), inn.conf(5), innd(8), libinn_dbz(3),
213 makedbz(8), ovdb_init(8), overchan(8), ovsqlite-server(8).
214
215
216
217INN 2.7.0 2022-07-10 MAKEHISTORY(8)