Database is borked, need help

David Relson relson at osagesoftware.com
Wed Sep 22 23:40:49 CEST 2004


On Wed, 22 Sep 2004 13:57:46 -0700
Chris Wilkes wrote:

> On Wed, Sep 22, 2004 at 04:07:17PM -0400, Chris wrote:
> > Hello.
> > 
> > I tried to teach my database that a certain email was not spam
> > using:  bogofilter -n <filename.  It freaked out and told me:
> > 
> > RECOVERY: Fatal error, run database recovery
> 
> Usually a simple
>   bogoutil -d ./wordlist.db | bogoutil -l ./wordlist.db-new
> will re-recreate your wordlist for you in the file wordlist.db-new
> If that doesn't work try doing a db_dump and db_load:
>     db_dump -r -f wordlist.dump ./wordlist.db
>     db_load -f wordlist.dump wordlist.db-new
>  and wordlist.db-new should a wordlist you can use.
> 
> Chris

BerkeleyDB also includes a db_recover command that's worth trying.

To guard against b0rked databases, I run an hourly cronjob that
1) copies wordlist.db to a new location
2) runs db_verify to determine if the copy is good
3) if good, rename the copy to wordlist.db.OK

This script ensures that I always have a recent backup.  

My script also appends to a logfile the token and message counts. 
Having done this for approx 2 yrs, I have a historical record of how my
wordlist has been growing.  It's not useful, but it is kinda fun :-)

Regards,

David



More information about the Bogofilter mailing list