-
☆ A M B ☆
- 24,524 Posts
I’ll do the code for the ability to truncate certain user logging tables in the database; the Manager is changing so much though that I’m not sure where I should do this. Perhaps an addition to the new Backup Manager? Would it be better to remove all but the last X number of records than to simply truncate the whole table? Does the event_log table keep growing as well? If so, I will add that to the list of tables to work with. If I use the existing Backup Manager, I’ll also add the manager_log table.
-
☆ A M B ☆
- 24,524 Posts
for now I’m just hacking the bkmanager.static.action.php script; that part’s already done. Now I need to create a new processor to truncate the indicated tables (I’m only enabling this on five tables; event_log, log_access, log_hosts, log_visitors and manager_log. Should be done in a couple of hours. Yes, I’m slow, so shoot me; that’ll only make me slower
Line 123-124 becomes
<?php
// enable record deletion for certain tables
// [email protected]
// 08-2005
if($db_status['Name'] == $table_prefix."event_log" || $db_status['Name'] == $table_prefix."log_access" || $db_status['Name'] == $table_prefix."log_hosts" || $db_status['Name'] == $table_prefix."log_visitors" || $db_status['Name'] == $table_prefix."manager_log") {
echo "<td align='right'>";
echo "<a href='index.php?a=500&u=".$db_status['Name']."'>".nicesize($db_status['Data_length']+$db_status['Data_free'])."</a>";
echo "</td>";
} else {
echo "<td align='right'>".nicesize($db_status['Data_length']+$db_status['Data_free'])."</td>";
}
// end record delection mod
?>
<td align="right"><?php echo $db_status['Data_free']>0 ? "<a href='index.php?a=500&t=".$db_status['Name']."'>".nicesize($db_status['Data_free'])."</a>" : "-" ; ?></td>
-
☆ A M B ☆
- 24,524 Posts

found a problem with the bkmanager.static.action.php script involving the optimize_table option links. Am working on the issue. Creating a new processor to handle both optimization and trucation for bkmanager.
-
☆ A M B ☆
- 24,524 Posts
Ok, all done (I think...)
Three files: Replace manager/actions/static/bkmanager.static.action.php, /manager/index.php, and add userlogs.processor.php to /manager/processors.
(or patch bkmanger.static.action.php as below, and patch manager/index.php at line 812 as following)
case "500" :
include_once "processors/userlogs.processor.php";
break;
-
☆ A M B ☆
- 24,524 Posts
No, the table is being truncated. That is why I modified the bkmanager and not the system info, because you can get a dump of the table before you truncate it if you want to keep the data. You could load the .sql file into a local database for further manipulation or whatever you want with it, while getting it off the remote server. Most hosting plans count database size as part of your hard disk quota, the same as files, so a constantly growing database can cause a big problem.
-
☆ A M B ☆
- 24,524 Posts
Has anybody been able to check this and verify that it works? I don’t want to release it "in the wild" until somebody else sees that it’s actually a Good Thing.
Hi Susan,
Many thanks.
I’ll have a look at it then check it in
Hi Susan,
Here’s a link to the TP3.2 updates that contains your truncate fixes. I’ve merged the userlog files to the optimized table.
http://modxcms.com/forums/index.php/topic,793.msg4879.html#msg4879