Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Can I safely empty LUM_IpHistory?
I wonder if I can safely empty this table if I don't have IP logging on any more? It's nearly 6mb in size so it would be handy. Could someone please re-assure me?
0
Comments
Mine was 16Mb!
I think the Forum Statistics extension uses this table?
Surely there's a better way to keep this as a counter? Does it really need to keep all the IP addresses or will a counter do?
It's not where the "Last Known Ip" is stored because when I emptied that table, the information is still there.
AFAIK, this is used for the Who's Online, IP History, and Statistics extensions, all of which I've got installed.
I decided to whip up a monthly clean-up script that runs via crontab. Maybe it'll be useful for someone. You should replace the DB, TABLE, MYSQL_USER, MYSQL_PW and LOGFILE variables to something appropriate for your server. The INTERVAL is in days. This script also assumes it's accessing the database on localhost:
#! /usr/local/bin/bash if [ $# -ne 0 ] then echo "No arguments accepted to this script right now" exit 1 fi DB='vanilla' TABLE='LUM_IpHistory' INTERVAL=30 LOGFILE=$HOME'/trim-vanilla.log' MYSQL_USER='sql' MYSQL_PW='pw' echo "Deleting records older than $INTERVAL days of IP history from $DB" echo "$0 run at: `date`" >> $LOGFILE /usr/local/bin/mysql -u $MYSQL_USER -p$MYSQL_PW -e "use $DB; DELETE FROM $TABLE WHERE DateLogged < DATE_SUB(NOW(), INTERVAL $INTERVAL DAY); OPTIMIZE TABLE $TABLE;" >> $LOGFILE
The crontab entry looks like so, which runs the script weekly at 2:40am. Any additional output the script creates is also appended to the logfile:
4 2 * * 0 /path/to/trim-vanilla-ip-history >> $HOME/trim-vanilla.log
To run the script monthly:
4 2 1 * * /path/to/trim-vanilla-ip-history >> $HOME/trim-vanilla.log