=head1 NAME

scanspool - Perform a sanity scan over all articles in news spool

=head1 SYNOPSIS

B<scanspool> [B<-cnrv>] [B<-a> I<active-file>] [B<-s> I<spool-dir>]

=head1 DESCRIPTION

B<scanspool> is a Perl script for use with a I<tradspool> article spool.
It will scan the F<active> file as well as all articles in the spool and
report on the errors it encounters.  As this may take a while, using the
B<-v> switch is recommended to see how far the program has progressed.

B<scanspool> will skip any file named other than just all-digits when treating
the contents of the news spool.

First, B<scanspool> scans the F<active> file, noting problems such as:

=over 4

=item *

malformed lines;

=item *

duplicate entries;

=item *

newsgroups aliased to a non-existent newsgroup;

=item *

newsgroups aliased to a newsgroup that is also aliased.

=back

Then it will examine all articles under your news spool directory,
complaining about articles that:

=over 4

=item *

have a basename that starts with a leading 0;

=item *

have a basename that is out of range according to the low and high water marks
of the F<active> file;

=item *

do not contain a Newsgroups header field;

=item *

are in a directory for which there is no newsgroup in the F<active> file;

=item *

are in a newsgroup to which they do not belong.

=back

B<scanspool> will also complain about directories with an all-digit component
as they may conflict with a possible file with the same name.

B<scanspool> understands aliased newsgroups.  Thus, if an article is posted
to foo.old.name that is aliased to foo.bar, it will be expected to
be found under foo.bar and not foo.old.name.

B<scanspool> assumes that the path of a valid newsgroup's directory
from the root of the spool tree will not contain any C<.> character.
Thus, directories such as F<out.going>, F<tmp.dir>, F<in.coming> and
F<news.archive> will not be searched.  This program also assumes that
article basenames contain only decimal digits.  Last, files under
the top level directory F<lost+found> are not scanned.

=head1 OPTIONS

=over 4

=item B<-a> I<active-file>

The F<active> file to use; I<pathdb>/active is the default.

=item B<-c>

Only check article filenames.  B<scanspool> will therefore not actually
scan the Newsgroups header field of the articles.

=item B<-n>

Don't throttle B<innd> while scanning.

=item B<-r>

Remove articles reported to have a problem.  To see the list of articles in
question, run B<scanspool> without this flag first.

Be warned that using this flag may result in inaccessible articles if articles
are removed whereas they are perfectly valid articles.  Have a look at them to
ensure they can be safely removed, and then use this flag.

=item B<-s> I<spool-dir>

The root of the spool tree; I<patharticles> is the default.

=item B<-v>

Setting this flag enables a verbose mode.  B<scanspool> will then print
which newsgroup is currently worked upon.  It will list all the articles
found in non-F<active> directories (that is to say articles sorted into
groups no longer present in the F<active> file), rather than just printing
the group once.

=back

=head1 DIAGNOSTICS

The output of B<scanspool> will start with one of the following forms:

=over 4

=item C<FATAL:> (to stderr)

Fatal or internal error.

=item C<WARNING:> (to stderr)

F<active> or article format problem, newsgroup alias problem, find(1)
error, article open error.

=item C<path/123:> (to stdout)

Issues such as:

=over 4

=item *

basename starts with 0;

=item *

article number out of range;

=item *

article in the wrong directory;

=item *

article in a directory not related to an F<active> non-aliased newsgroup.

=back

=item C<\t ...> (to stdout)

Verbose messages start with a tab.

=back

=head1 HISTORY

B<scanspool> was written by Landon Curt Noll (chongo was here /\../\).

This manual page was written by Florian Schlichting, largely based on
comments in the script.

=head1 SEE ALSO

active(5).

=cut
