Not signed in (Sign In)

Categories

Vanilla 1.1.5 is a product of Lussumo. More Information: Documentation, Community Support.

Help keep Vanilla free:
Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
    • CommentAuthorcircuit
    • CommentTimeMay 21st 2007
     # 1
    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?
  1.  # 2
    Certainly shouldn't do any harm I dont think. Best way would be to mysql-dump it first so you have a backup. Then you can replace it if you need to.
    • CommentAuthorcircuit
    • CommentTimeMay 21st 2007
     # 3
    thanks. i'll report back if anything goes wrong.
    • CommentAuthorchris
    • CommentTimeNov 23rd 2007
     # 4
    i just did this, 24mb, crikey.
    •  
      CommentAuthorWanderer
    • CommentTimeNov 25th 2007
     # 5
    Crikey times two!

    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.
    •  
      CommentAuthorrel1sh
    • CommentTimeDec 11th 2007 edited
     # 6
    Ah the dreaded LUM_IpHistory.

    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
Add your comments
    Username Password
  • Format comments as