eb849c690a
This little script establishes a framework for database cleanup on some regular schedule. Initial implementation provides for brute truncation of the sessions table, and selective-by-age cleanup of the zebraqueue. Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
79 lines
3.1 KiB
Text
79 lines
3.1 KiB
Text
# Koha Example Crontab File
|
|
# Author: Joe Atzberger <atz@liblime.com>
|
|
#
|
|
# This is an example of a crontab file for Debian. It may not work
|
|
# in other versions of crontab, like on Solaris 8 or BSD, for example.
|
|
#
|
|
# While similar in structure,
|
|
# this is NOT an example for cron (as root). Cron takes an extra
|
|
# argument per line to designate the user to run as. You could
|
|
# reasonably extrapolate the needed info from here though.
|
|
#
|
|
# WARNING: These jobs will do things like charge fines, send
|
|
# potentially VERY MANY emails to patrons and even debar offending
|
|
# users. DO NOT RUN OR SCHEDULE these jobs without being sure you
|
|
# really intend to. Make sure the relevant message templates are
|
|
# configured to your liking before scheduling messages to be sent.
|
|
#
|
|
# ENVIRONMENT:
|
|
# First, establish Koha's two important ENV variables.
|
|
|
|
PERL5LIB=/home/liblime/kohaclone
|
|
KOHA_CONF=/home/liblime/kohaclone/etc/koha-conf.xml
|
|
|
|
# Some additional variables to save you typing
|
|
KOHA_CRON_PATH = /home/liblime/kohaclone/misc/cronjobs
|
|
#
|
|
# MULTIPLE KOHA SUPPORT:
|
|
# You can still run jobs for this user's additional koha installs,
|
|
# by manipulating those variables in the command.
|
|
#
|
|
# For example, on the same codebase:
|
|
# */10 * * * * KOHA_CONF=/home/liblime/koha-test/etc/koha-conf.xml /home/liblime/kohaclone/misc/migration_tools/rebuild_zebra.pl -b -a -z >/dev/null
|
|
#
|
|
# For example, on a separate codebase:
|
|
# */10 * * * * KOHA_CONF=/home/liblime/koha-test/etc/koha-conf.xml PERL5LIB=/home/liblime/koha-test /home/liblime/koha-test/misc/migration_tools/rebuild_zebra.pl -b -a -z >/dev/null
|
|
#
|
|
# ADDITIONAL INFO:
|
|
# See the perldoc of individual scripts to determine what other options
|
|
# are available. Check the man page for crontab to understand the
|
|
# schedule syntax for your system.
|
|
#
|
|
# NOTE: Don't forget to keep the empty line at the bottom.
|
|
# Cron/crontab will choke without it.
|
|
#
|
|
# SCHEDULED JOBS:
|
|
# m h dom mon dow command
|
|
|
|
# OVERDUE NOTICES
|
|
0 1 * * * $KOHA_CRON_PATH/overdue_notices.pl -t
|
|
|
|
# FINES
|
|
5 1 * * * $KOHA_CRON_PATH/fines.pl
|
|
|
|
# ADVANCE NOTICES
|
|
10 1 * * * $KOHA_CRON_PATH/advance_notices.pl -c
|
|
|
|
# PROCESS LONG OVERDUES
|
|
# updates item status from available to longoverdue for items long overdue
|
|
# 19 1 * * * $KOHA_CRON_PATH/longoverdue.pl --lost 90=1 --confirm
|
|
|
|
# SEND EMAILS
|
|
15 * * * * $KOHA_CRON_PATH/process_message_queue.pl
|
|
|
|
# Hourly holds queue updated
|
|
52 * * * * $KOHA_CRON_PATH/holds/build_holds_queue.pl >/dev/null 2>&1
|
|
|
|
# ZEBRA INDEX UPDATES with -z option, incremental index updates throughout the day
|
|
# for both authorities and bibs
|
|
*/10 * * * * $KOHA_CRON_PATH/../migration_tools/rebuild_zebra.pl -b -a -z >/dev/null
|
|
|
|
# services_throttle -- resets the xISBN service
|
|
59 23 * * * $KOHA_CRON_PATH/services_throttle.pl > /dev/null 2>&1
|
|
|
|
# ROTATE LOGS
|
|
# Obviously, one needs logrotate(8) to do this
|
|
# 20 1 * * * /usr/sbin/logrotate -s /home/liblime/kohaclone/var/run/zebradb/logstatus /home/liblime/kohaclone/etc/logrotate.conf
|
|
|
|
# clean up databases nightly. Be sure not to run this with --sessions during a time when the system is in use!
|
|
16 1 * * * $KOHA_CRON_PATH/cleanup_database.pl --sessions --zebraqueue 10
|