[PREVIOUS CHAPTER] [NEXT CHAPTER]

3 archive

    3.1	Introduction

    Articles in $DIR/spool requires a lot of spaces if the number of
    articles are many (e.g. 1000 articles may need 2M). You can use "gzip"
    (GNU zip) 100 articles to be 1/4 size tar.gz archived file. In my
    experience 100 articles to be gzip-ped to be 50K size tar.gz. 50K
    seems an appropriate size for one mail. You can save spaces a lot by
    archiving articles.

    3.2	Automatic archive and Expire

    Spooling $DIR/spool must be a kind of "archive" (plain format), but in
    this document we distinct "archive" and "spooling". Here "archive" is
    to pack several articles to one file (e.g. tar.gz) and to store them
    in some directories.

    Running archive and expire BY HAND must be safe. FML can expire or
    archive articles automatically.  The variables are $USE_EXPIRE
    (expire) and $USE_ARCHIVE (archive).

    Notions of $USE_EXPIRE (expire) and $USE_ARCHIVE (archive) conflicts
    each other.  If you set both variables, pay attention on the values.
    Default parameters can be considered for this possibility.

    Usually we want not to lose ML articles. Hence running both expire
    and archive at the same time conflicts each other. Firstly it is
    difficult to choose parameters. Secondly archive depends on "gzip"
    and "tar", external system commands. It may be broken and may be
    mis-replaced for version up. On the other hand expire code does not
    depends such a thing. You can run "expire" without archive safely.
    Running both functions depends on your confidence :) or tore-lance
    that articles may be lost.

    To do both archive and expire by hand is best.  To do automatic
    archive and expire by hand must be second best.
    If you want to use both, firstly use only archive and check it.
    After checking archive works well, set expire.

    Configuration parameters require $EXPIRE_LIMIT is "number" (articles
    left in $DIR/spool) NOT "DAYS" (expire date). It also requires

    	$EXPIRE_LIMIT > $ARCHIVE_UNIT

    We recommend such as conditions

    	$EXPIRE_LIMIT = $ARCHIVE_UNIT * 2;

    3.3	Why "gzip" articles?

    1. Why gzip articles? It is to save directory usage. Compression rate
    is very high since each headers are similar each other.

    2. to avoid a large directory cache in the unix kernel.

4.1 Conversion to "gzip"ed file (archive file)

    If you would like to create archives by hand, please run archive.pl.

    	archive.pl [-dh] [-A ARCHIVE_DIR][-u unit] range

    	-d	debug mode
    	-h	help

    	-d	debug mode
    	-h	help
    	-A	archive directory (overwrite $ARCHIVE_DIR)
    	-u	unit	(overwrite $ARCHIVE_UNIT)
    	range	scan 1-range articles and pack them

    Please run thig program in $DIR, a mailing list home (config.ph
    location).  E.g.

    	% cd /var/spool/ml/Elena
    	% perl bin/archive.pl

    Run "archive.pl -u 100 2000" to crate 20 tar.gz files in $ARCHIVE_DIR.
    Each tar.gz file contains 100 articles. $DIR/spool has original
    articles in tar.gz, which are not removed. Please remove them by hand
    after checking tar.gz contents.

    % ls

    MSendrc		actives		config.ph	deny
    guide		help		list		log
    members		objective	seq		spool
    summary		welcome

    % test -d var || mkdir var
    % test -d var/archive || mkdir var/archive
    % perl archive.pl 3800

    	a lot of messages ...

    % ls archive

    100.tar.gz   200.tar.gz

    	a lot of messages ...

    4.2	Automatic archive creation (run archive.pl by cron)

    For example, you can run the following command to run archive.pl by
    cron once in a week (morning on Sun) in the following:

       (chdir /var/spool/ml/Elena; /usr/local/bin/perl bin/archive.pl)

    It is useful to set up a shell script for plural ML's.

    crontab example:

    	0 * * * * /bin/sh /usr/libexec/fml/archive.sh

    [/usr/libexec/fml/archive.sh]

    	#!/bin/sh

    	(cd /var/spool/ml/Elena;    /usr/local/bin/perl bin/archive.pl)
    	(cd /var/spool/ml/Freekick; /usr/local/bin/perl bin/archive.pl)

[PREVIOUS CHAPTER] [NEXT CHAPTER]