RE: Processing months of archives

2000-07-24 15:34:20
I used a similar approach but take one step further which also update the
top level index.html file to insert 2 URL for the respective index files.

if ( ! -d $outdir ) {
    # oops! it's missing, let's create it
    mkdir $outdir, 0755;
    # we need to update the master index file
    $index = $basedir . "index.html";
    if ( -e $index ) {
        $saved = $index . "~";
        if ( rename $index, $saved ) {
           open(OUT,">$index") || die "cannot open target index file: $index
           open(REF,"$saved" ) || die "cannot open reference index: $saved
           # copy line by line
               print OUT $_;
               if ( $_ =~ /index starts here/ ) {
                   # add in new index for this month
                   print OUT "<tr>";
                   print OUT "<td>$month</td>";
                   print OUT "<td>[<A
                   print OUT "<td>[<A
                   print OUT "</tr>\n";
           # change file protection for index
           chmod 0666, $index;

However, I'm struggling in file protection rights.  Since my pipe is done
within the mail aliases file, the script inherited ownership of
"daemon:other".  The default umask of "daemon:other" is rw-r-----.  This
means the web server cannot read the output files.  Is there an easy way to
change this?


-----Original Message-----
From: Andrew McGregor [mailto:andrew(_at_)niss(_dot_)ac(_dot_)uk]
Sent: Tuesday, February 08, 2000 5:18 AM
To: Email Archive
Cc: mhonarc(_at_)ncsa(_dot_)uiuc(_dot_)edu
Subject: Re: Processing months of archives

to archive on a monthly basis i filter my mails in a .forward
file and then call a pl script.  pls note our email is not 
sendmail but exim ( so i dont know if sendmail 
supports the same commands.

# .forward
#Exim filter
if error_message then finish endif

# Get todays month and year and pipe content off
if $tod_log matches "^(....-..)"
        pipe "/path-to-scripts/ ${local_part} ${1}"

# Script to create dated mhonarc forums for Eduserv Exploder
# Usage "cat message | <rcfile-prefix> <date>"
# e.g.  " niss 1999-12"

# Designed for use with exim and specifically to allow the creation
# of directories on the fly.

# Static Vars
my $docdir = '/path-to-htdocs/exploder';
my $confdir = '/path-to-config/exploder';

# Get Runtime Args
my $local_part = shift;
my $month = shift;

# Set output directory and the config file accordingly
my $outdir = "$docdir/$local_part/$month";
my $config = "$confdir/$local_part" . "-exploder.rc";

# Include MhOnarc code
require '';

# Create Date directory if it doesn't exist
unless ( -d "$outdir" )

  mkdir "$outdir",0755 or die "$0: failed to create dir: $outdir: $!\n";

# Initialise Mhonarc


# Process Message
                '-rcfile', "$config",
                '-outdir', "$outdir",

Email Archive wrote:

Hiya all,

I am working on getting mhonarc setup. Anyone have any pretty
rc files that i can use as examples? I also have the problem
that I have been archiving email for months and months
in one large file per email list. Does anyone know of a way
to split up this file so mhonarc can process it on a month
by month basis? How can I automate this month by month processing
for the future? I would like to archive it as email comes in
but once a month.. generate new web pages and link them to
a main index page so users can just view a specific month
of a mailing list.

Thanks.. Mike

Andrew McGregor, EduServ (NISS), PO BOX 2674, BATH, BA2 7XY.
T: 01225 826 826 ext. 3419; F: 01225 826 177; E: am(_at_)niss(_dot_)ac(_dot_)uk
e-mail to mobile < 140 chars: 
<Prev in Thread] Current Thread [Next in Thread>
  • RE: Processing months of archives, Loong Jackson-ljl004 <=