update_totalissues.pl --use-stats
  update_totalissues.pl --use-items
  update_totalissues.pl --commit=1000
  update_totalissues.pl --since='2012-01-01'
  update_totalissues.pl --interval=30d


This batch job populates bibliographic records' total issues count based on historical issue statistics.


Prints this help


Provide verbose log information (list every bib modified).


Use the data in the statistics table for populating total issues.


Use items.issues data for populating total issues. Note that issues data from the items table does not respect the --since or --interval options, by definition. Also note that if both --use-stats and --use-items are specified, the count of biblios processed will be misleading.


Only process issues recorded in the statistics table since DATE.


Only process issues recorded in the statistics table in the last N units of time. The interval should consist of a number with a one-letter unit suffix. The valid suffixes are h (hours), d (days), w (weeks), m (months), and y (years). The default unit is days.


Add the number of issues found in the statistics table to the existing total issues count. Intended so that this script can be used as a cron job to update popularity information during low-usage periods. If neither --since or --interval are specified, incremental mode will default to processing the last twenty-four hours.


Commit the results to the database after every N records are processed.


Only test the popularity population script.


If the time on your database server does not match the time on your Koha server you will need to take that into account, and probably use the --since argument instead of the --interval argument for incremental updating.


This patch to Koha was sponsored by the Arcadia Public Library and the Arcadia Public Library Foundation in honor of Jackie Faust-Moreno, late director of the Arcadia Public Library.


Jared Camins-Esakov <jcamins AT cpbibliography DOT com>