MAKEHISTORY(8)

NAME
makehistory - tools to recover Usenet history database.

SYNOPSIS
makehistory [ -A oldtmp ] [ -a active ] [ -b ] [ -D dir ] [ -d dir ] [ -f filename ] [ -h file ] [ -I file ] [ -i ] [ -n ] [ -O ] [ -o ] [ -R ] [ -r ] [ -S ] [ -s size ] [ -T tmpdir ] [ -t [ H|h|S|s ] ] [ -U ] [ -u ] [ -v ] [ -x ]

DESCRIPTION

Makehistory rebuilds the history(5) text file and the associated dbz(3) database. The default name of the text file is <pathdb in inn.conf>/history; to specify a different name, use the ``-f'' flag. Makehistory scans the active(5) file to determine which newsgroup directories within the spool directory, <patharticles in inn.conf>, should be scanned. (If a group is removed, but its spool directory still exists, makehistory will ignore it.) The program reads each file found and writes a history line for it.

Makehistory also restores articles stored by traditional method through storage api. If this is done, unified overview database and its index can be created together. The translation into traditional method is not supported.

After the text file is written, makehistory will build the dbz database.

OPTIONS

-A  If the ``-A'' flag is used then the argument given is the pathname makehistory can use to store a copy of the history file as it's being built. It will be appended to, so existing data will not be lost (and so should be valid history entries).

-a  If the ``-a'' flag is given then the argument is the active file to use rather than the default one of <pathdb in inn.conf>/active.

-b  If the ``-b'' flag is used, then makehistory will remove any articles that do not have valid Message-ID headers in them.

-D  If the ``-D'' flag is used, then dir is used as traditional spool directory. This directory is used for translating traditional stored articles into new storing method through storage api. The default is <patharticles in inn.conf>. This flag is valid if ``-t'' flag is used.

-d  If the ``-d'' flag is used, then dir is used as overview directory. This directory is used for translating traditional stored articles into new storing method through storage api. The default is <pathoverview in inn.conf>. This flag is valid if ``-t'' flag is used.

-f  If the ``-f'' flag is used, then the database files are named file.dir , file.index and file.hash. If the ``-f'' flag is not used, then a temporary link to the name history.n is made and the database files are written as history.n.index , history.n.hash and history.n.dir.

-h  If the ``-h'' flag is used, then file is used as old history. This file is used for translating traditional stored articles into new storing method through storage api. The default is <pathdb in inn.conf>/history. This flag is valid if ``-t'' flag is used.

-I  If the ``-I'' flag is used, then the index of article overview are appended to the specified file. This file can be created if storage api is used and ``-O'' flag is used. With this file, you can make new overview index file. To do this,

    sort -t' ' +1 -2 file | <PREFIX specified with --prefix at configure>/expireindex -a -o -z

    If translation is done based on history, the ``-I'' and ``-O'' flag is used without ``-R'' flag and the article is stored through storage api, makehistory just makes index for overview data and history. In case that only index for overview data needed to be created, use the ``-x'' flag not to create new history.

-i  To ignore the old database use the ``-i'' flag. Using the ``-o'' flag implies the ``-i'' flag.

-O  If the ``-O'' flag is used, then overview database is also created. This can be used for translating traditional stored articles into new storing method through storage api. Note that if the ``-O'' flag is used, existing overview database will be overwritten. To avoid this behavior, use ``-d'' flag to specify another overview directory.

-o  If the ``-o'' flag is used, then the link is not made and any existing history files are overwritten. If the old database exists, makehistory will use it to determine the size of the new database.

    Note if ``-t'' with ``H'' or ``h'' is specified together, ``-o'' will break old history and the operation is failed.

-n  To scan the spool directory without rebuilding the dbz files, use the ``-n'' flag. If used with ``-u'', the server will not be throttled while scanning.

-R  If the ``-R'' flag is used, then old articles are removed if translation is done. This is used for translating traditional stored articles into new storing method through storage api. This flag is valid if ``-t'' flag is used.

-r  To just build the dbz files from an existing text file, use the ``-r'' flag. The ``-i'' or ``-s'' flags can be useful if there are no valid dbz files to use.

-S  If the ``-S'' flag is used, then articles stored by traditional method are ignored. This can be used for translating traditional stored articles into new storing method through storage api.

-s  The program will also ignore any old database if the ``-s'' flag is used to specify the approximate number of entries in the new database. Accurately specifying the size is an optimization that will create a more efficient database. (The size should be the estimated eventual size of the file, typically the size of the old file.) For more information, see the discussion of dbzfresh and dbzsize in dbz(3).

-T  Makehistory needs to create a temporary file that contains one line for each article it finds, which can become very large. This file is created in the <pathtmp in inn.conf> directory. The ``-T'' flag may be used to specify a temporary directory. In addition, the sort(1) that is invoked during the build writes large temporary files (often to /var/tmp but see your system manpages). If the ``-T'' flag is used, then the flag and its value will be passed to sort. On most systems this will change the temporary directory that sort uses. If used, this flag and its value will be passed on to the sort(1) command that is invoked during the build. The default temporary directory for sort used by makehistory is <pathtmp in inn.conf>.

-t  If the ``-t'' flag is used, then makehistory translates stored articles into new storing method through storage api. With an additional flag, makehistory determines to how to retrieve traditional stored articles.

    H       retrieve from history
    h       same as H
    S       retrieve from spool
    s       same as S

    Retrieving from history translates articles stored by both traditional method and storage api. Retrieving from spool will only translates articles stored by traditional method. Normally, translation from spool takes longer time, since makehistory reads every directory for each newsgroup in active(5) even if no article exists.

    If translating from spool, makehistory adds ``Xref'' header with pathname, if the article has no ``Xref'' header. If makehistory does this, the article is assumed not to be crossposted.

    ``-t'' flag and ``-u'' cannot be used together.

-U  If the ``-U'' flag is used, then any crossposted (linked) articles are removed if translation is done. This is used for translating traditional stored articles into new storing method through storage api. This flag is valid if ``-t'' flag is used. If ``-U'' flag is not used even if ``-t'' flag is used, there still remain all crossposted (linked) articles, and

-u  If the ``-u'' flag is given, then makehistory assumes that innd is running. It will throttle the server while scanning, and then send ``addhist'' commands (see ctlinnd(8)) to the server for any article that is not found in the dbz database. The command ``makehistory -bu'' is useful after a system crash, to delete any mangled articles and bring the article database back into a more consistent state.

-v  If the ``-v'' flag is used with the ``-u'' flag, then makehistory will put a copy of all added lines on its standard output.

-x  If the ``-x'' flag is used, makehistory will never write history. This flag is valid only if the ``-t'' with ``h'' and ``-O'' is used without ``-R'' flag.

EXAMPLES

A typical way to use this program is with the following
    /bin/sh commands:

    ctlinnd throttle "Rebuilding history file"
    cd <pathetc in inn.conf>
    if makehistory -n -f history.n ; then
        :
    else
        echo Error creating history file!
        exit 1
    fi
    # 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
    # if <DBZ_TAGGED_HASH in config.data> is DO
        mv history.n.pag history.pag
    # else DONT
        mv history.n.index history.index
        mv history.n.hash history.hash
    # fi
    fi
    ctlinnd go ''

HISTORY
Written by Rich $alz <rsalz@uunet.uu.net> for InterNetNews.

SEE ALSO
active(5), ctlinnd(8), dbz(3), filechan(8), history(5), inn.conf(5), innd(8), newsfeeds(5), makeactive(8), newsrequeue(8).