re: digest to mbox

1997-06-12 08:48:27
Here is a simple script I wrote to process the archives of my Listprocessor 

# - Process all Listprocessor archives using MHonArc
# Kevin McCann
#### Directory locations:
# Listproc, Majordomo, or Listserv top archives dir 
$ARCHDIR = "/usr/server/archives";
# MhonArch web archives directory   
$MONDIR = "/u/www/htdocs/listproc/mhonarc";
## Let's figure out what lists exist
opendir(DIR,"$ARCHDIR/") || die "Can't open directory";
@dirs = readdir(DIR);
@sorteddirs = sort @dirs;
for (@sorteddirs) {      # processing a list
   $listname = $_;
   opendir(DIR,"$ARCHDIR/$listname") || die "Can't open directory";
   @logs = readdir(DIR);
   @sortedlogs = sort @logs;
   for (@sortedlogs) {
     if (/log/) {                # processing files with name format 
       $log = $_;

       system("/usr/local/bin/mhonarc  -outdir  $MONDIR/$listname/$log  

                 # modify the above command line as needed 

}             # end of script

I processed over 100 lists that go back to 1995 with this. It took about 
one hour. There may be more elegant ways to do it, but this was just a 
quick hack to get the job done. If you are using an RCFILE, don't forget to 
include it in the long mhonarc command seen above. Oh, and don't forget to 
change the first line that specifies your Perl location if you need to - 
mine is set to /usr/local/bin/perl5.

Good luck!

- Kevin McCann

<Prev in Thread] Current Thread [Next in Thread>