Bug 7240

Summary: Cleaning up import tables and action_logs
Product: Koha Reporter: Marcel de Rooy <m.de.rooy>
Component: Command-line UtilitiesAssignee: Marcel de Rooy <m.de.rooy>
Status: CLOSED FIXED QA Contact: Ian Walls <koha.sekjal>
Severity: enhancement    
Priority: P3 CC: chris, dev_patches, katrin.fischer, paul.poulain
Version: 3.8   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Patch
Patch
Bug 7240: Cleaning up import tables and action_logs

Description Marcel de Rooy 2011-11-17 12:28:43 UTC
I already asked on dev list:
> Is anyone of you using code to periodically purge records from 
> import_records, import_biblios, import_batches and/or action_logs ?
> 
> If so, would it be an idea to include such code into 
> cleanup_database.pl in misc/cronjobs ?

Response of Paul on dev list:
+1 Sounds a very good idea. We have already made a dirty mysql "truncate xxx" on some setups IIRC. Would be better to have it in cleanup_database.

I also agree it should be driven by a parameter, like the number in days to keep/clean. Something like cleanup_database --import 90 --action_logs 180 (90 days for import_* tables and 180 for action logs in this example)

And if no parameter are given, either do nothing or remove after a default duration (30 for import ? 90 for action_logs ?)


Will be sending a proposed patch.
Comment 1 Marcel de Rooy 2011-11-21 12:44:53 UTC Comment hidden (obsolete)
Comment 2 Marcel de Rooy 2011-11-21 12:47:29 UTC
four should be five
Comment 3 Marcel de Rooy 2011-11-21 12:51:33 UTC Comment hidden (obsolete)
Comment 4 Chris Cormack 2011-12-13 09:13:13 UTC
Created attachment 6741 [details] [review]
Bug 7240: Cleaning up import tables and action_logs

This patch lets cleanup_database also purge older records from the (five) import tables and the action_logs table.
Two new command line parameters are introduced: --import and --logs.
If no number of days is specified for --zebraqueue, --import or --logs, it defaults to 30 days, 60 days resp. 180 days.
I did not add a default for --sessdays, because this parameter cannot be seen separately from parameter --sessions.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

Adds new parameters and code, does not change existing behaviour
Comment 5 Paul Poulain 2012-01-13 13:04:19 UTC
QA comment: easy to read code -congrat-, usefull feature,  properly documented. The only perlcritic error was here before the patch

passed QA

patch pushed please test
Comment 6 Jonathan Druart 2013-07-16 12:39:38 UTC
*** Bug 6793 has been marked as a duplicate of this bug. ***