logs - database

Post Reply
Kelevra
Posts: 99
Joined: Tue Mar 25, 2014 5:01 pm

logs - database

Post by Kelevra »

Hi, how can I clean the logs? It is so big I can't even open on the browser anymore... IPs history, outs and so on...

script V 1.52

Code: Select all

admin_access_log	InnoDB	32
admin_sessions	MyISAM	3
admins	InnoDB	16
blacklist	InnoDB	16
bookmarks	MyISAM	1435
browsers	MyISAM	164907
countries	InnoDB	16
day	MyISAM	96
day_last_hour	MyISAM	137
forces	MyISAM	1
functions_data	MyISAM	5
ga_categories	InnoDB	16
ga_sites	InnoDB	16
history	MyISAM	9772
inrules	InnoDB	16
ips	MyISAM	1357754
ips_history	MyISAM	4157
language	MyISAM	117429
links	MyISAM	506423
out_ips	MyISAM	1564019
out_ips2trader	MyISAM	70362
outrules	InnoDB	16
quality_settings	InnoDB	16
refs	MyISAM	211431
Kelevra
Posts: 99
Joined: Tue Mar 25, 2014 5:01 pm

Re: logs - database

Post by Kelevra »

Well, I have cleaned it one by one,, should cron clean it every day?
admin
Site Admin
Posts: 37202
Joined: Wed Sep 10, 2008 11:43 am

Re: logs - database

Post by admin »

if you run it every minute - yes
Don't forget to run script update
Kelevra
Posts: 99
Joined: Tue Mar 25, 2014 5:01 pm

Re: logs - database

Post by Kelevra »

Here is a example how I am runnign these cronjobs ( in the example below, its for one site only, but there are several of them)
I have to do this way because server load was going crazy with all them running together
Anyway to make this work running every min?

Code: Select all

#!/bin/bash
ME=`basename $0`
PIDFILE=/tmp/${ME}.pid
if [ -e ${PIDFILE} ]
then
   PID=`cat ${PIDFILE}`
   kill -0 ${PID} > /dev/null 2>&1
   if [ $? -eq 0 ]
   then
      echo "Process already running: ${PID}"
      exit 1
   else
      echo "Stale lock file found. Cleaning up."
      rm -f ${PIDFILE}
   fi
fi

echo ; echo $$ > ${PIDFILE}

function finish {
   rm -f ${PIDFILE}
}
trap finish EXIT

		echo ; echo "/home/httpd/html/xxx.xxx/public_html"
                cd /home/httpd/html/xxx.xxx/public_html/ggpw/bin; /bin/timeout 30s env HTTP_HOST=xxx.xxx/usr/bin/php -q cron.php ; sleep 2 ;
           exit 0
               
                
admin
Site Admin
Posts: 37202
Joined: Wed Sep 10, 2008 11:43 am

Re: logs - database

Post by admin »

With 1.52 you need to run cron every minute
in version 2 this behavior has been fixed.

if you don't run it every minute you have several choices
- run it odd minute one day and even another day
- somehow check what minute it has been run and run on another minute next day
- clean logs manualy

or move to version 2
Don't forget to run script update
Post Reply