Bug 15935 - Provide koha-cleanup-database command for package install
Summary: Provide koha-cleanup-database command for package install
Status: CLOSED INVALID
Alias: None
Product: Koha
Classification: Unclassified
Component: Command-line Utilities (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Galen Charlton
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-02-29 14:53 UTC by Ian Palko
Modified: 2016-12-05 21:22 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ian Palko 2016-02-29 14:53:26 UTC
We have provided commands for the most important command line actions for package users, but there are yet several important commands which require calling the .pl file directly. 

The commands provided by the packages take into account the location of koha-conf.xml and perl files for the instance provided or detected, but do not seem to use the environmental variable KOHA_CONF and PERL5LIB directly.

As a result it seems that the Debian/Ubuntu packages do not presently set up these environmental variables. On package installs executing the commands not yet provided for requires manually setting these variables.

For instance, when trying to run the cleanup_database.pl utility on a package install it will fail because KOHA_CONF is not specified. To allow it to work one must manually set this variable.

I propose the creation a command for the package installs called "koha-cleanup-database" which will avoid the use of environmental variables, but provide for package users the ability to cleanup their databases.

I propose this utility because of its value -- we have been cataloging a 40,000 volume library and from all the z39.50 searches our database had reached over 1.5 GB. On the non-package install we cleaned up the database down to only 120 MB by removing the old z39.50 searches and the whole setup is much more stable and fast. Upgrading to a package install on a new server, we have lost this functionality.
Comment 1 Katrin Fischer 2016-02-29 22:43:53 UTC
Hi Ian,

koha-cleanup-database is supposed to be run as a daily cronjob and normally not run manually. If you look into your cronjob configuration you can change the options it's run with to fit your library's needs and clean up the z39.50 imported records regularly.

There is also a tool that helps to run any of the scripts from command line - it sets up all the right environment variables for you: 
https://wiki.koha-community.org/wiki/Commands_provided_by_the_Debian_packages#koha-shell
Comment 2 Ian Palko 2016-03-02 14:36:38 UTC
(In reply to Katrin Fischer from comment #1)
> Hi Ian,
> 
> koha-cleanup-database is supposed to be run as a daily cronjob and normally
> not run manually. If you look into your cronjob configuration you can change
> the options it's run with to fit your library's needs and clean up the
> z39.50 imported records regularly.
> 
> There is also a tool that helps to run any of the scripts from command line
> - it sets up all the right environment variables for you: 
> https://wiki.koha-community.org/wiki/
> Commands_provided_by_the_Debian_packages#koha-shell

Katrin,

Thanks for the information. 

Somehow I missed the koha-shell. After a number of years of Koha, you'd think I'd be more diligent in reading documentation.

The reason for the manual command started with Kyle Hall's sugggeston and highlighting the database bloat with z39.50 records. Also, our cronjobs are not running as expected. I suspect a local configuration problems, even though it's a fresh vanilla package setup.

The koha-shell does do what I needed without a new command, so I'll close the enhancement bug.