Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2010-07-15 11:58:03

geoff777
Plugin Author
From: Benarrabá Andalucía Spain
Registered: 2008-02-19
Posts: 282
Website

LOGS not being deleted

Hi,

In Admin Prefs I have delete logs set to … after 2 days.

I noticed today that I had 333,000+ rows in the table.

I’ve manually deleted them but does anyone have any ideas why isn’t this happening automatically?

Thanks

Geoff


There are 10 types of people in the world: those who understand binary, and those who don’t.

Offline

#2 2010-07-15 12:51:32

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: LOGS not being deleted

geoff777 wrote:

I’ve manually deleted them but does anyone have any ideas why isn’t this happening automatically?

Old rows are deleted only when site admin visits the Visitor Logs admin panel. If no one has visited the panel lately, there might be older records.

Offline

#3 2010-07-15 14:50:02

geoff777
Plugin Author
From: Benarrabá Andalucía Spain
Registered: 2008-02-19
Posts: 282
Website

Re: LOGS not being deleted

Wow!

I’m surprised that there wasn’t 300,000,000 rows … I can’t remember the last time I clicked on that tab.

Okay .. I’ll click on it daily from now on.

Thanks


There are 10 types of people in the world: those who understand binary, and those who don’t.

Offline

#4 2010-07-15 15:56:01

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: LOGS not being deleted

If you don’t look at the logs, you may want to consider disabling logging completely.

Offline

#5 2010-07-16 19:33:35

geoff777
Plugin Author
From: Benarrabá Andalucía Spain
Registered: 2008-02-19
Posts: 282
Website

Re: LOGS not being deleted

ruud wrote:

If you don’t look at the logs, you may want to consider disabling logging completely.

I use mem_online_users which uses the logs.

I also save daily totals using smd_query on txp_log.

I hadn’t given this any thought until I saw number of rows in the table.
I had wrongly assumed that when I set a number of days to keep the logs for in Admin Prefs that deleting older records would be handled by Textpattern.
I had thought the deletion was a daily “behind the scenes” clean-up … a cron job?

Now I know this isn’t he case I’ll keep a closer check on the table.

When I total the previous day’s visitors, I’ll now delete the records.

Thank
Geoff

Last edited by geoff777 (2010-07-16 19:44:20)


There are 10 types of people in the world: those who understand binary, and those who don’t.

Offline

#6 2010-07-16 19:56:39

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: LOGS not being deleted

geoff777 wrote:

I had thought the deletion was a daily “behind the scenes” clean-up … a cron job?

Well, the problem is that TXP is just an application written in PHP. PHP by itself can’t do timed tasks. Instead, it just does something when told to.

If the in-build cleaning was timed, it would mean that the cleaning would be checked and done on the frontside of the site. The problem is that it would slow the pages down and databases do not really like constant deleting. Sure, we could store time intervals and run deleting systematically, but even then some of the visitors would experience slower page loading. This is basically why the cleaning is done on the Visitor logs panel.

That said, if you want to setup a cron job and run cleaning silently, every other day, you can. You can install cron job that opens mysql connection and removes old rows. This tutorial might come handy:

Brainbell.com / PHP&MySQL / Cron Jobs Tutorial

Offline

Board footer

Powered by FluxBB