Summary: | Cleaning up import tables and action_logs | ||
---|---|---|---|
Product: | Koha | Reporter: | Marcel de Rooy <m.de.rooy> |
Component: | Command-line Utilities | Assignee: | 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 |
Created attachment 6367 [details] [review] Patch This patch lets cleanup_database also purge older records from the (four) 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. four should be five Created attachment 6368 [details] [review] Patch 4->5 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 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 |
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.