📄 news-recovery.8
字号:
.\" $Revision: 1.14 $.TH NEWS-RECOVERY 8.SH NAMEmakeactive, makehistory, newsrequeue \- tools to recover Usenet databases.SH SYNOPSIS.B makeactive[.B \-m][.B \-o].B makehistory[.B \-b][.BI \-f " filename"][.B \-i][.B \-n][.B \-o][.B \-r][.BI \-s " size"][.BI \-T " tmpdir"][.B \-u[.B \-v]].B newsrequeue[.BI \-a " active"][.BI \-h " history"][.BI \-d " days"][.B \-l][.BI \-n " newsfeeds"][.I input].SH DESCRIPTION.I Makeactiveinvokes.IR find (1)to get a list of all directories in the news spool tree,.\" =()<.IR @<_PATH_SPOOL>@ .>()=.IR /var/spool/news/spool .It discards directories named.I lost+foundas well as those that have a period in them.It scans all other directories for all-numeric filenames and determinesthe highest and lowest number.The program's output is a set of.IR active (5)file lines.Because there is no way to know if a group is moderated or disabled,the fourth field of all entries will be.IR y .Also, mid-level directories that aren't newsgroups will also created asnewsgroups with no entries (for example, there is a ``comp.sources.unix''group, but no ``comp.sources'')..PPIf the ``\-o'' flag is used,.I makeactivewill read an existing.I activefile for the list of group names and just renumber all groups.It will preserve the fourth field of the.I activefile if one is present.This is analogous to the.IR ctlinnd (8)\&``renumber'' command, except that.IR innd (8)should throttled or not running.Do not use this flag with output redirected to the standard active file!.PPIf the ``\-m'' flag is given, then.I makeactivewill attempt to adjust the highest and lowest article numbers whereverpossible.If articles are found in a newsgroup, the numbers will reflect whatwhat was found.If no articles are found in a newsgroup, the high number from the oldfile will be kept, and the low number will be set to one more thenthe high number.This flag may only be used if the ``\-o'' flag is used..PP.I Makeactiveexits with non-zero status if any problems occurred.A typical way to use the program is with the following.I /bin/shcommands:.RS.DT.nfctlinnd throttle "Rebuilding active file".\" =()<.ds R$ @<_PATH_ACTIVE>@>()=.ds R$ /var/spool/news/data/active.\" =()<TEMP=${TMPDIR-@<_PATH_TMP>@}/act$$>()=TEMP=${TMPDIR-/tmp}/act$$if [ \-f \*(R$ ] ; then if makeactive \-o >${TEMP} ; then mv ${TEMP} \*(R$ f\&ielse if makeactive >${TEMP} ; then # Edit to restore moderated # and aliased groups. \&.\|.\|. mv ${TEMP} \*(R$ f\&if\&ictlinnd reload active "New active file"ctlinnd go ''.fi.RE.PP.I Makehistoryrebuilds the.IR history (5)text file and the associated.IR dbz (3)database.The default name of the text file is.\" =()<.IR @<_PATH_HISTORY>@ ;>()=.IR /var/spool/news/data/history ;to specify a different name, use the ``\-f'' flag..I Makehistoryscans the.IR active (5)file to determine which newsgroup directories within the spool directory,.\" =()<.IR @<_PATH_SPOOL>@ ,>()=.IR /var/spool/news/spool ,should be scanned.(If a group is removed, but its spool directory still exists,.I makehistorywill ignore it.)The program reads each file found and writes a history line for it.If the ``\-b'' flag is used, then.I makehistorywill remove any articles that do not have valid Message-ID headers in them..PPAfter the text file is written,.I makehistorywill build the.I dbzdatabase.If the ``\-f'' flag is used, then the database files are named.I file.dirand.IR file.pag .If the ``\-f'' flag is not used, then a temporary link to the name.I history.nis made and the database files are written as.I history.n.pagand.IR history.n.dir .If the ``\-o'' flag is used, then the link is not made and any existinghistory files are overwritten.If the old database exists,.I makehistorywill use it to determine the size of the new database.To ignore the old database use the ``\-i'' flag.Using the ``\-o'' flag implies the ``\-i'' flag.The program will also ignore any old database if the ``\-s'' flag is usedto specify the approximate number of entries in the new database.Accurately specifying the size is an optimization that will create a moreefficient database.(The size should be the estimated eventual size of the file, typicallythe size of the old file.)For more information, see the discussion of.I dbzfreshand.I dbzsizein.IR dbz (3)..PPIf the ``\-u'' flag is given, then.I makehistoryassumes that.I inndis running.It will pause the server while scanning, and thensend ``addhist'' commands (see.IR ctlinnd (8))to the server for any article that is not found in the.I dbzdatabase.The command ``makehistory\ \-bu'' is useful after a system crash, to deleteany mangled articles and bring the article database back into a moreconsistent state.If the ``\-v'' flag is used with the ``\-u'' flag, then.I makehistorywill put a copy of all added lines on its standard output..PPTo scan the spool directory without rebuilding the.I dbzfiles, use the ``\-n'' flag.If used with ``-u'', the server will not be paused while scanning.To just build the.I dbzfiles from an existing text file, use the ``\-r'' flag.The ``\-i'' or ``\-s'' flags can be useful if there are no valid.I dbzfiles to use.A typical way to use this program is with the following.I /bin/shcommands:.RS.nfctlinnd throttle "Rebuilding history file".\" =()<cd @<_PATH_NEWSLIB>@>()=cd /var/spool/news/dataif makehistory \-n \-f history.n ; then :else echo Error creating history file! exit 1f\&i# The following line can be used to retain expired history# It is not necessary for the history file to be sorted.# awk 'NF==2 { print; }' <history >>history.n# View history file for mistakes.if makehistory \-r \-s `wc \-l <history` \-f history.n; then mv history.n history mv history.n.dir history.dir mv history.n.pag history.pagf\&ictlinnd go ''.fi.RE.PP.I Makehistoryneeds to create a temporary file that contains one line for each articleit finds, which can become very large.This file is created in the.\" =()<.I @<_PATH_TMP>@>()=.I /tmpdirectory.The ``TMPDIR'' environment variable may be used to specify adifferent directory.Alternatively, the ``\-T'' flag may be used to specify a temporary directory.In addition, the.IR sort (1)that is invoked during the build writes large temporary files (often to.IR /var/tmpbut see your system manpages).If the ``\-T'' flag is used, then the flag and its value will be passed to.IR sort .On most systems this will change the temporary directory that.I sortuses.if used, this flag and its value will be passed on to the.IR sort (1)command that is invoked during the build..PP.I Makehistorydoes not handle symbolic links.If the news spool area is split across multiple partitions, the followingcommands should probably be run before the database is regenerated:.RS.nf.\" =()<cd @<_PATH_SPOOL>@>()=cd /var/spool/news/spoolfind . -type l -name '[1-9]*' -print | xargs -t rm.fi.REMake sure to run the command on all the appropriate partitions!.PP.I Newsrequeuecan be used to rewrite batchfiles after a system crash.It operates in two modes.In the first mode, it first reads the.I activeand.IR newsfeeds (5)files to determine where the different newsgroups are to be distributed.To specify alternate locations for these files, use the ``\-a'' or ``\-n''flags.It then opens the.I historydatabase.To specify a different file, use the ``\-h'' flag.PPOnce the files are opened,.I newsrequeuereads from the specified.I inputfile, or standard input if no file is specified.Each line should have a single Message-ID, surrounded in angle brackets;any other text on the line is ignored.For example, the history file (or trailing subset of it) is acceptableinput to the program operating in this mode.If the ``\-d'' flag is used, then only articles that were receivedwithin the specified number of.I dayswill be processed..PP.I Newsrequeueuses the first two fields of the.I newsfeedentry \(em the sitename and the excludes field, and the patterns anddistribs field.It ignores all flags in the third field except for the ``N'' field, andalso ignores the fourth field altogether..PPThe second mode is used if the ``\-l'' flag is used.In this mode, it reads from the specified.I inputfile, or standard input if no file is specified.Each line should look like an.I inndlog entry.It parses entries for accepted articles, looks up the Message-ID in thehistory database to get the filename, and then scans the list ofsites..PPIn either mode, the output of.I newsrequeueconsists of one line for each article that should be forwarded.Each such line contains the Message-ID, the filename, and the list ofsites that should receive the article.The output is suitable for piping into.IR filechan (8)..SH HISTORYWritten by Rich $alz <rsalz@uunet.uu.net> for InterNetNews..de R$This is revision \\$3, dated \\$4....R$ $Id: news-recovery.8,v 1.14 1993/03/18 21:03:41 rsalz Exp $.SH "SEE ALSO"active(5),ctlinnd(8),dbz(3),filechan(8),history(5),innd(8),newsfeeds(5).
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -