You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Miguel <mm...@123.com.sv> on 2008/03/27 18:32:17 UTC
purge byes in sql
Hi, does SA takes care of purging old bayesian records stored in mysql
similar what it does to the traditional DB files?
If not, what is the recommended procedure to do so?
regards
Re: purge byes in sql
Posted by Ken Menzel <ke...@icarz.com>.
Hi Miguel,
I run /usr/local/bin/sa-learn --force-expire daily with MySQL and it
works fine.
Here is an excellent slide show on use SQL with SA:
http://people.apache.org/~parker/presentations/MO13slides.pdf
You may also find these SQL queries helpful, I run them monthly.
echo "Starting Monthly AWl purge - "
echo "Delete AWL entries older than 4 months";
$MYSQL -u$USER -p$PW -h$SERVER -e\
"SELECT count(*) as 4MonthOld FROM awl WHERE lastupdate <=
DATE_SUB(SYSDATE(), I
NTERVAL 4 MONTH);" \
$DB
$MYSQL -u$USER -p$PW -h$SERVER -e\
"DELETE FROM awl WHERE lastupdate <= DATE_SUB(SYSDATE(), INTERVAL 4
MONTH);" \
$DB
echo "Delete AWL entries with only a single e-mail over 30 days old"
$MYSQL -u$USER -p$PW -h$SERVER -e\
"SELECT count(*) as 30DayOldSingles FROM awl WHERE count = 1 AND
lastupdate <= D
ATE_SUB(SYSDATE(), INTERVAL 30 DAY);" \
$DB
$MYSQL -u$USER -p$PW -h$SERVER -e\
"DELETE FROM awl WHERE count = 1 AND lastupdate <= DATE_SUB(SYSDATE(),
INTERVAL
30 DAY);" \
$DB
echo "Check for insignigcant scoring AWL entries"
$MYSQL -u$USER -p$PW -h$SERVER -e\
"SELECT count(*) as Insignificant FROM awl WHERE totscore/count < .1 AND
totscor
e/count > .1;" \
$DB
$MYSQL -u$USER -p$PW -h$SERVER -e\
"DELETE FROM awl WHERE totscore/count < .1 AND totscore/count > .1;" \
$DB
$MYSQL -u$USER -p$PW -h$SERVER -e\
"SELECT count(*) as TotalBayesSeen FROM bayes_seen;" \
$DB
echo "Delete bayes seen older than 1 month"
$MYSQL -u$USER -p$PW -h$SERVER -e\
"SELECT count(*) as 1MonthOldBayesSeen FROM bayes_seen WHERE lastupdate
<= DATE_
SUB(SYSDATE(), INTERVAL 1 MONTH);" \
$DB
$MYSQL -u$USER -p$PW -h$SERVER -e\
"DELETE FROM bayes_seen WHERE lastupdate <= DATE_SUB(SYSDATE(), INTERVAL
1 MONTH
); " \
$DB
Miguel wrote:
> Hi, does SA takes care of purging old bayesian records stored in mysql
> similar what it does to the traditional DB files?
> If not, what is the recommended procedure to do so?
> regards
>
Re: purge byes in sql
Posted by Theo Van Dinter <fe...@apache.org>.
On Thu, Mar 27, 2008 at 11:32:17AM -0600, Miguel wrote:
> Hi, does SA takes care of purging old bayesian records stored in mysql
> similar what it does to the traditional DB files?
Yes.
--
Randomly Selected Tagline:
"My opinions may have changed, but not the fact that I am right."
- Ashleigh Brilliant