It seems like every so often somebody asks a question like this.
Unfortunately the examples given on the Mhonarc web page are exceedingly
obscure. They seem to be pitched to people who have an advanced
understanding of Unix and inter-process communications. I have only been
working with Unix (Aix actually) and Perl for 5 years, but personally have
trouble understanding the examples.
I am working with only partial success to create month-based archives using
a perl script. While the script does take care of the job of creating a new
subdirectory based on a date call, I am still having problems with the
actual results. Furthermore, the script does not address itself to date
anomalies which are crucial for proper archiving. My mailing list has some
messages that, for example, are dated Oct 31, but are filtered into the
November archive--only because they arrived after midnight, Nov. 1.
I am struggling with 2 different scripts. The first, depicted below, has
problems actually creating the "Otherindex", but does everything else okay.
The second is an attempt to interrogate the "Date: " line of the message in
order to filter it into the proper directory. Feedback would be most welcome.
$date = `date`;
@date_tbl = split(" ", $date);
$month = @date_tbl;
$year = @date_tbl;
$return = `ls /users/lnp3/public_html/archives`;
if ($return !~ /$month$year/)
`chmod a+x /users/lnp3/public_html/archives/$month$year`;
`/usr/local/bin/mhonarc -add -rcfile