MHonArc: HTML archives per year

In my section on SmartList, I present an rc-file for maintaining a per-year HTML archive of a SmartList based mailing-list. (It essentially calls mhonarc -add -quiet -outdir /path/to/html_archive/$year, where $year is the four-digit year). However, that rc-file does not care about special settings for the archives; it simply assumes that you either create the configuration file(s) for MHonArc manually, or use its default settings.

Here, I am presenting my way of automating this process. It consists of a set of M4 files, plus a shell script for updating the per-year directories. (M4 is a macro processor, i.e., something like the C preprocessor, but with a different syntax, and more powerful.) The script assumes the GNU version of M4 because GNU M4 knows the options -I (directory for include instructions) and -D (define a symbol).

The files and directories

The main directory of the list archive contains If you maintain the archives for several mailing lists in "neighbour" directories (like I do for several lists to which I am subscribed--I store them in $HOME/public_html/mailinglists/listname/year), you may find it convenient that you can store most of the m4 files in the (common) parent directory of the list's main directories, in my case, in $HOME/public_html/mailinglists (that's the reason for -I.. in M4 invocation in the shell script).

So, all that' missing is the shell script that takes all these files and does "the magic". It is invoked in the main archive directory, with one argument that indicates the language of the list. Some of the m4 files above have names something_en.m4. I also have something_de.m4 for German lists. For the English lists, I call update_compact en, for the German lists I call update_compact de.

How it all works together

To be completed.
Hans-Albert Schneider
Last modified: Mon Jan 21 23:50:11 CET 2002