mhonarc-users

Re: Duplicate Message Clean-up

2001-09-06 19:31:45
On September 6, 2001 at 15:38, "James Roman" wrote:

The messages got duplicated due to the fact that I never empty the source
mailbox and the
archive database got reset.  So, when it went to do its daily processing it
interpreted all
the messages in the mailbox as new messages.  This ended up creating all of
the duplicate
message files.  Though only 4200 messages show up via the scan command.

From you original message, it implied that the 16,000 message files
were part of the active archive and not where many were left-overs, no
longer managed by MHonArc.  If you reset an archive, you should delete
all unneeded files in the archive directory before recreating the
archive.  Since MHonArc does not make the assumption that is the sole
user of a directory, it tries to avoid overwriting existing files.

For your problem, a fast solution is to parse the output of the scan
command to extract all the valid message numbers being used to determine
which files are valid and to remove files that do not have the specified
message numbers.

Or, you can use the following resource file (lets call it
"filenames.mrc") and command to print out the list of files MHonArc
knows about in and archive:

-- start filenames.mrc --
<Main>
<NoThread>
<LiTemplate>
$MSGPREFIX$$MSGNUM$.$HTMLEXT$
</LiTemplate>
-- end filenames.mrc --

The command to run:

  shell> mhonarc -genidx -rc filenames.mrc -out /path/to/archive | grep '^msg'

(the command assumes that MSGPREFIX is set to default value of "msg"; if
 not, change the string used in the grep command to match value)

The command should generate the list of message filenames that MHonArc
is managing in the archive.  You can then use the list as input to
a script to remove message files that are not on the list.  CAUTION:
You should do this process only when there are no archive updates
occuring.  I.e.  Disable any processes that can modify the archive
while deleting data, or you may delete valid message files.

Other, more efficient, alternatives exist if you know the internals of
MHonArc and right a custom program that loads MHonArc and extracts the
data you need.  An mha-clean utiltiy program could be written to remove
all unknown files from an archive directory.  The above should be
sufficient to solve your immediate problem.

--ewh

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