Jacob Yocom-Piatt wrote:
Olli Hauer wrote:
Jacob Yocom-Piatt wrote:
swapped out a spamd host last night and ended up doing some ksh scripting to get the spamdb up to date on the new machine. also have connected the old host with the new one using the sync (-y & -Y) options for spamd and spamlogd, and these options are working fine and are quite neat.

a couple of questions come to mind after having done this:

- is there a better way to migrate a spamd database from one machine to the other without using scripts like

pfctl -t spamd-white -T show | sed "s/ //g" > spamd-white.clean.txt (on old host) for i in `cat spamd-white.clean.txt`; do spamd -a $i; done; (on new host)




Just copy /var/db/spamd from the old to the new host, so you get all other
information as well (WHITE, SPAMTRAP, GREY, expire records).


this was going i386 -> sparc64 and spamd kept dying on me once the db was copied over. probably different binary formats or some such.


Ah, different platform then a crash make sense.

Since i have nearly 7500 SPAMTRAP addresses and a few scripts that analyze the
content of the spamd database i do a regular dump of spamdb.
With one of the scripts i do a revers lookup of the IP and some filtering for
potential blacklisting/delisting or permanent whitelisting.


#> spamdb > spamdb_$(date +%F).dump

Now i can transfer this file and do something like this.

for i in `grep ^WHITE ./spamdb_$(date +%F).dump | awk -F\| '{print $2}'` do 
spamdb -a $i; done
for i in `grep ^TRAPPED ./spamdb_$(date +%F).dump | awk -F\| '{print $2}'` do 
spamdb -ta $i; done
for i in `grep ^SPAMTRAP ./spamdb_$(date +%F).dump | awk -F\| '{print $2}'` do 
spamdb -Ta $i; done

Reply via email to