NEWSMAINT(8)

NAME
newshist - extract history line for news article(s)
newsdaily - maintain news log files and report problems
newswatch - keep an eye on news system for difficulties
newsboot - clean up news debris on reboot
locknews - lock news system
addgroup, delgroup - add and delete newsgroups, locally only
adddirs - make any missing directories for active newsgroups
addfeed - add a news feed
act.to.times - create active.times file for news readers
histfrom, newsfrom - list news arriving over specific time range
addmissing - add missing news articles to history file

SYNOPSIS
/usr/lib/newsbin/maint/newshist msgid ...
/usr/lib/newsbin/maint/newsdaily [ guru ... ]
/usr/lib/newsbin/maint/newswatch [ spacemin [ inbatchmax ] ]
/usr/lib/newsbin/maint/newsboot
/usr/lib/newsbin/maint/locknews [ -v ]
/usr/lib/newsbin/maint/addgroup group {y|n|m|x|=realgroup}
/usr/lib/newsbin/maint/delgroup group
/usr/lib/newsbin/maint/adddirs
/usr/lib/newsbin/maint/addfeed [ -L ] [ -f flags ] site groups
/usr/lib/newsbin/maint/act.to.times activefile
/usr/lib/newsbin/maint/histfrom startdate [ enddate ]
/usr/lib/newsbin/maint/newsfrom startdate [ enddate ]
/usr/lib/newsbin/maint/addmissing [ -d ]

DESCRIPTION
These programs are utilities useful in maintaining a C News system and diagnosing problems in it.

Newshist prints the history line for each article identified by a msgid.

Newsdaily performs minor maintenance chores that typically should be done once a day for the news system: saving copies of log files and truncating them, reporting logged errors, checking for anomalies suggesting something is wrong, and cleaning out leftover files. Newsdaily saves one generation of old log files and three generations of old errlog and batchlog files. It reports problems to the named gurus (default: `usenet').

Newswatch looks for indications of news problems on a shorter time scale than those reported by newsdaily, notably strangely-persistent lock files that may indicate a news-system failure. If spacemin is specified, newswatch checks the incoming, articles, control, and outbound areas to confirm that there are still at least spacemin bytes available in each, and reports it if not. If inbatchmax is specified, newswatch inspects the incoming-news spooling area and reports if more than inbatchmax files are awaiting processing. Newswatch delivers its report, if any, on standard output; an empty report (zero bytes of output) means no problems. It typically should be run a few times a day with any non-empty output mailed to someone suitable.

Newsboot should be run from /etc/rc or the system's equivalent on reboot. It cleans up files that the news system might have left lying about if the system crashed while news was being processed, notably old lock files.

Locknews locks the news system (retrying until it succeeds), starts up a shell ($SHELL if set, otherwise the system's standard shell) with the PS1 and prompt environment variables prepended with executable reminders, and waits around to unlock the news system when that shell terminates. This simplifies manual maintenance. -v produces messages on standard error upon successful locking and unlocking; this is only needed by users of shells that import neither PS1 nor prompt to set their prompts, notably C shells.

Addgroup and delgroup respectively add a newsgroup (with a specified flags field for the active file, normally `y' [see news(5)]) and delete a newsgroup manually, with proper locking. The effect is purely local; no control message (to propagate the change to other machines) is sent.

Adddirs sweeps through the active file checking that directories exist for all newsgroups. (Relaynews will create directories as needed, but some user-interface software gets upset if a newsgroup exists but its directory does not.) This is mostly useful when adding groups in bulk, based on another site's active file.

Addfeed adds a line to the sys file specifying that the site should be fed the groups, and creates a suitable outbound-batching directory. If the -L option is given, the L flag is included to restrict the feed to locally-generated articles only. If the -f option is given, then the argument following it is used as the flags field for the sys entry instead of the default f. If groups does not include a distribution list (separated from the newsgroups by a `/'), the default distribution list `/all' is appended. If groups is of the form =name, this specifies the same groups as those fed to site `name', with the exception that `to.name' is rewritten to `to.site'.

Act.to.times emits (on standard output) a new active.times file (see active.times(5)) based on the contents of activefile, which should normally be /usr/lib/news/active.

Histfrom emits (on standard output) all history lines for unexpired articles arriving between startdate and enddate. The dates must be acceptable to getdate (see newsaux(8)). The default enddate is ``now''.

Newsfrom runs histfrom and processes its output to produce a list of absolute pathnames of articles arriving between startdate and enddate (default ``now'').

Addmissing scans the history file and the news-article tree to find articles that are not in the history file, and adds them to the file and the dbz database. If the -d option is given, addmissing rebuilds the dbz database from scratch after adding the missing articles to the history file; this is a convenience for use in disaster-recovery situations where manual repairs to the history file have rendered the file incomplete and the dbz database invalid.

FILES
/usr/lib/news/history	history file
/usr/lib/news/history.pag	dbz database for history file
/usr/lib/news/history.dir	dbz database for history file
/usr/lib/news/log	current news log
/usr/lib/news/log.o	previous news log
/usr/lib/news/errlog	current news-error log
/usr/lib/news/errlog.o*	old news-error logs
/usr/lib/news/batchlog	current news-batcher log
/usr/lib/news/batchlog.o*	old news-batcher logs
/usr/spool/news/in.coming	input-spooling area
/usr/spool/news/out.going	output-batching area
/usr/lib/news/watchtime	last time newswatch was run
/usr/lib/news/active	list of current newsgroups
/usr/lib/news/active.old	backup copy created by addgroup and delgroup
/bin/sh	standard Unix shell
/bin/rc	standard Plan 9 shell

SEE ALSO
df(1), uucp(1), ls(1), ctime(3), getdate(3), hostname(1), grep(1), news(5), expire(8), newsbatch(8), rnews(8), newsaux(8)

DIAGNOSTICS
Locknews complains and exits if it is unable to lock the news system due to inadequate permissions.

Addfeed looks for a /default/ line or a line for site in the batchparms file, and if none is found, warns the user to create one.

Addmissing complains and exits if it is unable to lock the news system, if expire appears to be running, or if there is not enough space for a temporary copy of the history file and database. It also notes the presence of articles which did not have intelligible headers (which are placed into history with an entry specifying immediate expiry). Complaints from it about articles being ``already present'' indicate a corrupt history file rather than merely missing articles; a complete rebuild is indicated if the offending entries cannot be identified and removed manually.

HISTORY
Written at U of Toronto by Henry Spencer and Geoff Collyer.

BUGS
Delgroup does not remove files or directories from /usr/spool/news, although it prints a reminder to do so.

The =name form of addfeed cannot cope with continued sys lines.

Addfeed assumes that attention to the batchparms file suffices to get batching going for a new feed, which is naive if you are running sendbatches selectively, i.e. with arguments.

Addmissing balks at dealing with articles which are already in history but with an incomplete list of pathnames. This is very hard to fix.

Addmissing will falsely think articles are missing—leading to the problem above—if a newsgroup name has a component longer than 14 characters on a system which limits directory entries to 14. This too is fairly hard to fix.

Various nuisances can result if the maintenance utilities are run as root rather than as the owner of the news database. It's difficult to defend against this.