Bayes database - can it be copied?

Julian Field mailscanner at
Sun Apr 6 16:56:02 IST 2003

At 16:46 06/04/2003, you wrote:
>I've got two identical boxes, both running MS 4.14 and SA 2.53.  The first
>one is our 10 MX, the second is 20 MX.  The first gets a *lot* more mail
>than the second, and as a result the Bayes database is 90% larger than on
>MX 20.  Can I copy the bayes files in ~root/.spamassassion from the first
>machine to the second to "jump start" its Bayes functionality?

I think as long as you do it carefully, then you will probably be okay. The
critical time is between the creation/update of the 2 db files.

Say your machines are called mx10 and mx20, then something like this should
do it pretty well. I'm assuming you are using scp, but just change the scp
for rcp if that's what you are using.

On mx20:

cd ~root/.spamassassin
mkdir new_files 2>/dev/null
scp 'mx10:.spamassassin/*' new_files
mv -f new_files/* .

I do all the files at once to minimise the time when the db files aren't
consistent with each other, as this isn't doing any proper locking. Just
copying the files straight into ~/.spamassassin would make the
"inconsistent" time a lot longer.
Julian Field
Professional Support Services at
MailScanner thanks transtec Computers for their support

More information about the MailScanner mailing list