NEWSDB(5)

NAME
newsdb - USENET network news database: article tree, history, active, active.times

DESCRIPTION
Each news article is stored in a separate file with one or more links, each a numeric name in a directory under /usr/spool/news corresponding to a newsgroup the article is (cross-)posted to. For example, an article posted to comp.unix.wizards might be stored in /usr/spool/news/comp/unix/wizards/4867.

The file /usr/lib/news/active defines the locally-valid news groups and contains one line per group. Each line consists of four blank-separated fields: newsgroup name, highest local article number assigned, lowest local article number in use (approximately), and a flag. Both article-number fields are at least five digits wide. (Some older news software may expect exactly five digits.) The current flag values are y (a normal unmoderated group), n (like y but local postings disallowed), m (a normal moderated group), x (a locally-disabled group, no articles will be filed here), and = (followed by the real group under which to file articles in this group; articles are treated exactly as if their Newsgroups: header specified the real group instead of the original one; highest and lowest fields are ignored).

The file /usr/lib/news/active.times is an extension of the active file that records the arrival of new newsgroups by time and creator. When a new newsgroup is created, the group name, time of group creation (as seconds since January 1, 1970, 00:00, GMT), and mail address of the creator are appended as a single line. The file must always be sorted in increasing order of the creation-time field. The news software only appends to the file, which normally suffices to ensure this. An initial active.times for already existing newsgroups, with all times equal to the time of its creation and all creators ``unknown'', can be built using act.to.times (see newsmaint(8)). Active.times provides a quick way for newsreaders to tell when new groups have arrived, without weird heuristics and expensive schemes like storing old lists of newsgroups and comparing them to the active file.

The file /usr/lib/news/history contains one line for each article received. Each line consists of three tab-separated fields: a Message-ID:, the arrival time as seconds since midnight, Jan 1, 1970 and the Expires: value (a dash indicates there was none) separated by a tilde, and the list of links to this article. If an article has been expired or cancelled without being seen first, the list of links and the tab before it are omitted. There are also index files to permit rapid lookup by message-id, typically called /usr/lib/news/history.dir and /usr/lib/news/history.pag.

EXAMPLES
A trivial active file. control 0000600006 600004 y junk 0000000076 00074 y comp.org.usrgroup 0000000006 00004 y talk.bizarre 0000296123 292136 n comp.sys.sun 0000050175 50173 m list.sun-spots 0000000076 00076 =comp.sys.sun comp.os.vms 0000000000 00000 x

An trivial history file.
<3451@hcr.UUCP>    581905588~-    comp.text/1317 comp.sources.wanted/4200
<9383@alice.UUCP>    611934511~-

FILES
/usr/spool/news/news/group/1234
/usr/lib/news/active
/usr/lib/news/active.times
/usr/lib/news/history
/usr/lib/news/history.dir
/usr/lib/news/history.pag

SEE ALSO
dbz(1), nn(1), readnews(1), rn(1), dbz(3), getdate(3), getabsdate(3), news(5), newssys(5), expire(8), newshist(8), newsmaint(8), relaynews(8), newsinvaders(9.1)

BUGS
A single portable extended history database, containing more information about each article, might be useful for some newsreaders (notably nn and trn) and would eliminate the expense of running nnmaster and most especially mthreads. More importantly, sites that support more than one such newsreader would only need a single multi-megabyte database. On the other hand, gnus or gnews gets the same effect at run-time with no adjunct database, at little expense (or so their users claim).

HISTORY
Active.times invented by Mark Moraes and Geoff Collyer as part of the C News project.