Remitur Posted September 12, 2021 Share Posted September 12, 2021 Doing ordinary maintenance on WHMCS db, I asked myself a question: what's the goal of Whois lookup log? Just thousands of useless records, with timestamp and the name of the domain checked... Am I missing anything? Does exist any situation where this kind of information may be somehow useful? Right now, the only purpose I can find for this log is make us wasting time pruning it on a monthly basis... 0 Quote Link to comment Share on other sites More sharing options...
xyzulu Posted October 2, 2021 Share Posted October 2, 2021 (edited) I can't work it out either.. and.. there is no way to automatically prune it.. you'll need some mysql/phpmyadmin (as you are no doubt aware). I use (just to help others who find this thread): Quote DELETE FROM `tbllog_register` WHERE `created_at` < "2021-01-01" Replace the date with the oldest date you want to keep.. anything before then will be deleted... of course you will want to select the correct database first. Edited October 2, 2021 by xyzulu 1 Quote Link to comment Share on other sites More sharing options...
brian! Posted October 3, 2021 Share Posted October 3, 2021 On 12/09/2021 at 18:35, Remitur said: Am I missing anything? Does exist any situation where this kind of information may be somehow useful? I could think of a couple if the data was complete and valid... sadly it's not, so not very useful. 1 Quote Link to comment Share on other sites More sharing options...
Remitur Posted October 7, 2021 Author Share Posted October 7, 2021 On 10/2/2021 at 11:00 AM, xyzulu said: I use (just to help others who find this thread): Replace the date with the oldest date you want to keep.. anything before then will be deleted... of course you will want to select the correct database first. I've just setup a simple script to do this (and get rid of other useless stuff): function logcleaner($vars) { if (date('H') == '12' && intval(date('i')) < 5) { $deletedtblwhoislog=Capsule::table('tblwhoislog')->where('date', '<',date('Y-m-d', strtotime('-2 days')))->delete(); $deletedtblactivitylog=Capsule::table('tblactivitylog')->where('date', '<',date('Y-m-d', strtotime('-2 days')))->where('description','LIKE','%Automated Task: Starting%')->delete(); $deletedtblactivitylog2=Capsule::table('tblactivitylog')->where('date', '<',date('Y-m-d', strtotime('-2 days')))->where('description','LIKE','%Domain Sync Cron: Completed%')->delete(); $deletedtblactivitylog3=Capsule::table('tblactivitylog')->where('date', '<',date('Y-m-d', strtotime('-2 days')))->where('description','LIKE','%Cron running at%')->delete(); $deletedtbldns1=Capsule::table('dns_manager2_log')->where('date', '<',date('Y-m-d', strtotime('-2 days')))->where('value','LIKE','Cron Log Cleaner Started')->delete(); $deletedtbldns2=Capsule::table('dns_manager2_log')->where('date', '<',date('Y-m-d', strtotime('-2 days')))->where('value','LIKE','Cron Cleaner Started')->delete(); $deletedtbldns3=Capsule::table('dns_manager2_log')->where('date', '<',date('Y-m-d', strtotime('-2 days')))->where('value','LIKE','Cron Status Zone Started')->delete(); logActivity('log cleaning: tblwhoislog deleted '.$deletedtblwhoislog.' records - tblactivitylog deleted '.($deletedtblactivitylog+$deletedtblactivitylog2+$deletedtblactivitylog3).' records - dns_manager2_log deleted '.($deletedtbldns1+$deletedtbldns2+$deletedtbldns3).' records'); } } add_hook("AfterCronJob",5,"logcleaner"); This script runs daily, at a given hour (in the example code, every day at 12:00). In the example, there's the code to clean also of dns_manager2_log, useful only if you're using the DNS Manager Addon module by Modulesgarden) ref: https://domainregister.international/index.php/knowledgebase/667/WHMCS---Automated-Log-Cleaning-Hook.html 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.