Page 1 of 1

Spamfilter db location

Posted: Mon Nov 06, 2006 2:52 pm
by mad_dog
I may be overlooking this, but I cant seem to find the Spamfilter database with the filters/regexp's we created anywhere in the Unreal main dir. I would like to back these up so we dont have to re-create in the future.
Anyone point me to the correct file? Thanks in advance

Posted: Mon Nov 06, 2006 3:07 pm
by Grunt
Spamfilters added by yourself from IRC aren't saved in any file, but stored in memory and are lost when you shut down the server. Your best deal would be to save them all in spamfilter.conf (also make sure you have an include line in unrealircd.conf like this one: include "spamfilter.conf";)

Posted: Mon Nov 06, 2006 4:05 pm
by mad_dog
Thanks, was hoping would be easier *Laughs*. Think I will make a txt file instead and load it manually if the need arises, will just have to keep up on the listing as it changes

Posted: Tue Nov 07, 2006 7:40 pm
by JanisB
********bonus********

I am too lazy to add all this by hand, but after this code writing i can use "/backup" cmd to fetch all K:Lines/spamfilter's in da backup files and after server restart restore all this using mIRC-friendly formatted files (except 1st line).

NB!, if at backupping moment user has 1-day-left K:Line, and after backup you want to restore it after 2 weeks, user will be banned again for 1 day ;)

Aliases:

/backup {
set %timenow $asctime(yyyy-mm-dd_HH-nn-ss)
set %backup_data 1
set %klinebackup 1
echo -a starting K:Line backupping
/write " $+ $mircdir $+ logging\KLine_backup_ $+ %timenow $+ .log " K:Line recovery commands. ( $+ %timenow $+ )
/stats K
}
/spam_backup {
set %spamfilterbackup 1
set %backup_data 0
echo -a starting Spamfilter match backupping
/write " $+ $mircdir $+ logging\Spamfilter_backup $+ %timenow $+ .log " Spamfilter recovery commands. ( $+ %timenow $+ )
/stats f
}


Remote:

raw 223:*:{
if ( %klinebackup == 1 ) {
/write " $+ $mircdir $+ logging\KLine_backup_ $+ %timenow $+ .log " /kline $3 $4 $7-
halt
}
}
raw 229:*:{
if ( %spamfilterbackup == 1 ) {
/write " $+ $mircdir $+ logging\Spamfilter_backup $+ %timenow $+ .log " /SPAMFILTER add $3 $4 $7 $8 $10-
halt
}
}
raw 219:*:{
if ( %backup_data == 1 ) {
echo -a STATS backup finished.
/spam_backup
halt
} else {
set %klinebackup 0
set %spamfilterbackup 0
}
}