result of sqlite3 --> db conversion

Matthias Andree matthias.andree at gmx.de
Sat Jan 11 00:02:44 CET 2020


Am 10.01.20 um 19:13 schrieb Saša Janiška:
> Hello,
>
> I did not want to maintain my own sqlite3-based version of bogofilter and
> therefore converted it to *.db with:
>
> sqlite3 --> db:
>
> bogoutil -d .bogofilter/wordlist.db >.bogofilter/wordlist.txt
>
> import into db:
>
> bogoutil --db-transaction=yes -l .bogofilter/wordlist.db <.bogofilter/wordlist.txt
>
>
> Now, wordlist.db was timmed from 1.3G to 609M, but after conversion I'm left
> with some extra files:
>
> $ ls -l                                                                     
> total 4,8G
> -rw-r--r-- 1 gour gour 344K sij  10 19:00 __db.001
> -rw-r--r-- 1 gour gour  40K sij  10 19:00 __db.002
> -rw-r--r-- 1 gour gour  48K sij  10 19:00 __db.003
> -rw-r--r-- 1 gour gour    0 sij  10 15:51 lockfile-d
> -rw-r--r-- 1 gour gour 1,0K sij  10 18:48 lockfile-p
> -rw-r--r-- 1 gour gour 1,0M sij  10 19:00 log.0000001749
> -rw-r--r-- 1 gour gour 609M sij  10 15:56 wordlist.db
> ...
>
> and I wonder if I should keep those __db.*, lockfile-* and log.* files?
>
> When I verify db with:
>
> $ bogoutil --db-verify .bogofilter/wordlist.db
>
> it exits without any warning and
>
> $ db_verify ~/.bogofilter/wordlist.db                                                  
> BDB5105 Verification of /home/gour/.bogofilter/wordlist.db succeeded.
>
>
> so I wonder if everything is OK and if it is possible to get rid of those extra
> {__db.*, lockfile-*, log.*} files?

> I'm using bogofilter-1.2.5 along with Claws-Mail on Manjaro (Arch) Linux.
Hi Saša,

Given the file size in relation to the wordlist.db, I would consider
removing the files a vain endeavour.

the log.* file must not be deleted. bogofilter by default only keeps
those (usually only one) necessary for recovering the database in case
of crashes.
It could theoretically be removed in your situation with an intact .db
file, but next time something opens the database, it will be recreated
anyways.

The __db.* files and lockfile-* are only safe to remove if no bogo*
program is running or being started, but they all will be recreated next
time you're running a bogo* program. The __db.* files are created by
libdb, and the lockfile-* work around shortcomings of Berkeley DB < 4.4
(irrelevant today but no code has been written to take advantage of
Berkeley DB >= 4.4), lockfile* also serve as crash detectors so that
bogofilter normally performs auto-recovery when a previous process crashed.

Details are in the doc/README.db file that ships with bogofilter or is
installed with its docs. Some information is in the bogoutil manual page
and you may learn a bit by reading the bf_copy/bf_tar scripts.

Hope that helps.

Regards
Matthias


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://www.bogofilter.org/pipermail/bogofilter/attachments/20200111/23ca4ae3/attachment.sig>


More information about the bogofilter mailing list