copying wordlists

Matthias Andree matthias.andree at gmx.de
Wed Nov 24 12:28:02 CET 2004


"Eric Wood" <eric at interplas.com> writes:

> Can bogoutil issue a warning message and bail if we're using a transaction 
> database?  That way we're covered.

Not sure why this would be necessary. The basic operations, dump and
load a database, work the same, the problem is if a database is ripped
out of its environment, most importantly, the active log files.

If you rename the whole directory rather than just wordlist.db, you
should  be fine, like this:

# halt mail delivery to the account, for instance, by putting
# EXITCODE=75
# HOST
# up front in your .procmailrc, or,
# for maildrop: chmod +t ~
mv .bogofilter .bogofilter.old
bogoutil -d .bogofilter.old/wordlist.db | bogoutil -l .bogofilter/wordlist.db
# restart the mail system, comment out the .procmailrc lines
# or chmod -t ~

> Also maybe a bogoutil --force if we really mean what we're doing
> against a transactional database.

We can't force Berkeley DB to anything. If you break it through manual
intervention, nothing short of db_dump -r may work.

> We definitely need an FAQ about doing a bf_compact against a live database - 
> or are the delivery agents still have to temporarily halt till the bf_copy 
> is complete like it's always been?

bf_copy should be fine copying from a live database, it copies all
necessary files in the desired order and then runs recovery, so the
result will be fine, but you must not use the destination database
before bf_copy has completed - which is a minor constraint.

bf_compact currently needs to be run in the same filesystem as your
original directory is in, and requires source_dir to be a non-special
directory name, it cannot be . or .., and there will be a very short
window (between two subsequent mv commands) where the source directory
doesn't exist (because most POSIX systems, if not all, don't like
directory hard links).

-- 
Matthias Andree



More information about the Bogofilter mailing list