Configuring the crontab

Several Koha programs need to be run periodically. These programs calculate fines, generate overdue notices, send out e-mails, or build Zebra indexes.

We use Linux's Cron utility to schedule the execution of these programs.

Editing the crontab

The cronjobs are set up under the koha user's crontab. To edit the crontab we run the command crontab with the –e option:

koha@koha@linux:~> crontab -e

To save and exit, we use the vi command wq:

:wq

Setting up environment variables

The first thing we need to do is to set Koha related environment variables in the crontab; without these none of the cronjobs will execute. Add these lines in the crontab, somewhere at the top:

PERL5LIB=/home/koha/kohaclone
KOHA_CONF=/etc/koha-dev/etc/koha-conf.xml ...

Get Koha 3 Library Management System now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.