Page 1 of 1

logs - database

Posted: Fri Dec 04, 2020 4:26 pm
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

Re: logs - database

Posted: Fri Dec 04, 2020 5:34 pm
by Kelevra
Well, I have cleaned it one by one,, should cron clean it every day?

Re: logs - database

Posted: Sat Dec 05, 2020 5:09 am
by admin
if you run it every minute - yes

Re: logs - database

Posted: Sun Dec 20, 2020 11:07 pm
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
               
                

Re: logs - database

Posted: Mon Dec 21, 2020 6:09 am
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