bf_compact fails every night

Ben Finney ben at benfinney.id.au
Sun Feb 6 10:49:37 CET 2005


Howdy all,

This has been happening for a while now, but didn't seem to break
bogofilter's operation so I've delayed dealing with it.  In light of my
"catastrophic recovery required" thread, though, I'll describe it here
to see who can shed light.

=====
$ bogofilter --version 2>&1 | head -n 2
bogofilter version 0.93.5
    Database: Sleepycat Software: Berkeley DB 4.3.27: (December 22, 2004)
=====

Following what I understood of README.db, I have implemented a nightly
cron job of bf_compact:

=====
$ crontab -l | grep bf_compact
10 1    * * *   bf_compact ~/.bogofilter wordlist.db
=====

However, that fails every time with the error:

=====
mv: cannot overwrite directory `/home/bignose/.bogofilter.old/.bogofilter'
=====

It will work once, but it leaves a '.bogofilter.old' directory behind.
Subsequently:

=====
$ sh -x bf_compact ~/.bogofilter wordlist.db
+ set -e
+ '[' -z /home/bignose/.bogofilter ']'
+ BOGOHOME=/home/bignose/.bogofilter
+ '[' '!' -d /home/bignose/.bogofilter ']'
+ '[' -z wordlist.db ']'
+ FILE=wordlist.db
+ TEMP=bf_compact.6661
+ '[' -d bf_compact.6661 ']'
+ mkdir bf_compact.6661
+ test -f /home/bignose/.bogofilter/DB_CONFIG
+ cp -p /home/bignose/.bogofilter/DB_CONFIG bf_compact.6661
+ bogoutil -d /home/bignose/.bogofilter/wordlist.db
+ bogoutil -l bf_compact.6661/wordlist.db
+ bogoutil --db-prune=bf_compact.6661
+ mv /home/bignose/.bogofilter /home/bignose/.bogofilter.old
mv: cannot overwrite directory `/home/bignose/.bogofilter.old/.bogofilter'
=====

Thus, my home directory gets cluttered with a '.bogofilter.old'
directory, and a 'bf_compact.NNNN' directory for every time the 'mv'
fails.

This may have a bearing on why "catastrophic recovery required"
happened one day, but not the next time I tried it (as detailed in
another thread).

This is also a problem on its own, and I hope someone can help me fix
it.

-- 
 \       "We must respect the other fellow's religion, but only in the |
  `\       sense and to the extent that we respect his theory that his |
_o__)  wife is beautiful and his children smart."  -- Henry L. Mencken |
Ben Finney <ben at benfinney.id.au>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <http://www.bogofilter.org/pipermail/bogofilter/attachments/20050206/783bf439/attachment.sig>


More information about the Bogofilter mailing list