I seem to recall seeing something about this perhaps but can't find the solution.I have the package version of Koha 16.05.09.000 installed and running on Ubuntu 16.04 LTS using the instructions at https://wiki.koha-community.org/wiki/Koha_on_ubuntu_-_packages#Add_A_Koha_Co mmunity_Repository. Things seems to be working properly except that none of the scheduled tasks are running (zebra re-indexing, email notices, etc.). Neither root nor the Koha "owner" account have a crontab, so I'm wondering if the install was supposed to have created one or not? Can someone tell me what the crontab(s) should look like and which user they should run under, please? Anyone have a URL with instructions already? Thanks in advance! Steve
Excerpts from Steve Nickerson's message of 2017-02-18 13:38:56 -0500:
Can someone tell me what the crontab(s) should look like and which user they should run under, please? Anyone have a URL with instructions already?
Under my 16.11 installation, I see the following cron files, all owned by root but not appearing in the crontabs for root or any other user. I've copied them below, with the GPL3 notices stripped out for brevity. $ ls -laF /etc/cron*/koha* -rwxr-xr-x 1 root root 1674 Sep 22 16:15 /etc/cron.daily/koha-common* -rw-r--r-- 1 root root 516 Sep 22 16:15 /etc/cron.d/koha-common -rwxr-xr-x 1 root root 840 Sep 22 16:15 /etc/cron.hourly/koha-common* -rwxr-xr-x 1 root root 838 Sep 22 16:15 /etc/cron.monthly/koha-common* $ cat /etc/cron.daily/koha-common #!/bin/sh # /etc/cron.daily/koha-common -- Daily housekeeping tasks for all Kohas. # Copyright 2010 Catalyst IT, Ltd koha-foreach --enabled /usr/share/koha/bin/cronjobs/automatic_renewals.pl koha-foreach --enabled /usr/share/koha/bin/cronjobs/fines.pl koha-foreach --enabled --email /usr/share/koha/bin/cronjobs/overdue_notices.pl -t koha-foreach --enabled --email /usr/share/koha/bin/cronjobs/advance_notices.pl -c koha-foreach --enabled /usr/share/koha/bin/cronjobs/membership_expiry.pl -c koha-foreach --enabled /usr/share/koha/bin/cronjobs/holds/cancel_expired_holds.pl >/dev/null 2>&1 koha-foreach --enabled /usr/share/koha/bin/cronjobs/services_throttle.pl > /dev/null 2>&1 koha-foreach --enabled /usr/share/koha/bin/cronjobs/cleanup_database.pl --sessions --zebraqueue 10 --list-invites koha-foreach --enabled --noemail /usr/share/koha/bin/cronjobs/cleanup_database.pl --mail koha-foreach --enabled /usr/share/koha/bin/cronjobs/holds/auto_unsuspend_holds.pl > /dev/null 2>&1 koha-run-backups --days 2 --output /var/spool/koha $ cat /etc/cron.d/koha-common # /etc/cron.d/koha-common # # Call koha-rebuild-zebra for each enabled Koha instance, to make sure the # Zebra indexes are up to date. SHELL=/bin/sh PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin # Uncomment the following line if you do not want to use the koha-index-daemon integration # */5 * * * * root test -x /usr/sbin/koha-rebuild-zebra && koha-rebuild-zebra -q $(koha-list --enabled) */15 * * * * root koha-foreach --enabled --email /usr/share/koha/bin/cronjobs/process_message_queue.pl $ cat /etc/cron.hourly/koha-common #!/bin/sh # /etc/cron.hourly/koha-common -- Hourly housekeeping tasks for all Kohas. # Copyright 2010 Catalyst IT, Ltd koha-foreach --enabled /usr/share/koha/bin/cronjobs/holds/build_holds_queue.pl $ cat /etc/cron.monthly/koha-common #!/bin/sh # /etc/cron.monthly/koha-common -- Monthly housekeeping tasks for all Kohas. # Copyright 2015 Biblibre koha-foreach --enabled /usr/share/koha/bin/cronjobs/share_usage_with_koha_community.pl
Thank you Mark! As it turns out apparently my issue was that 'cron' was installed but not 'anacron'. I had those same /etc/cron.d, /etc/cron.daily, etc. files that you provided, but anacron wasn't installed/running, so they weren't being used. As soon as I added anacron things seem to be working now. Maybe anacron should be one of the dependencies for the koha-common package??? -----Original Message----- From: Mark Alexander [mailto:marka@pobox.com] Sent: Saturday, February 18, 2017 3:28 PM To: Steve Nickerson <stevenanickerson@gmail.com> Cc: koha <koha@lists.katipo.co.nz> Subject: Re: [Koha] cron issue with Koha on Ubuntu Excerpts from Steve Nickerson's message of 2017-02-18 13:38:56 -0500:
Can someone tell me what the crontab(s) should look like and which user they should run under, please? Anyone have a URL with instructions already?
Under my 16.11 installation, I see the following cron files, all owned by root but not appearing in the crontabs for root or any other user. I've copied them below, with the GPL3 notices stripped out for brevity. $ ls -laF /etc/cron*/koha* -rwxr-xr-x 1 root root 1674 Sep 22 16:15 /etc/cron.daily/koha-common* -rw-r--r-- 1 root root 516 Sep 22 16:15 /etc/cron.d/koha-common -rwxr-xr-x 1 root root 840 Sep 22 16:15 /etc/cron.hourly/koha-common* -rwxr-xr-x 1 root root 838 Sep 22 16:15 /etc/cron.monthly/koha-common* $ cat /etc/cron.daily/koha-common #!/bin/sh # /etc/cron.daily/koha-common -- Daily housekeeping tasks for all Kohas. # Copyright 2010 Catalyst IT, Ltd koha-foreach --enabled /usr/share/koha/bin/cronjobs/automatic_renewals.pl koha-foreach --enabled /usr/share/koha/bin/cronjobs/fines.pl koha-foreach --enabled --email /usr/share/koha/bin/cronjobs/overdue_notices.pl -t koha-foreach --enabled --email /usr/share/koha/bin/cronjobs/advance_notices.pl -c koha-foreach --enabled /usr/share/koha/bin/cronjobs/membership_expiry.pl -c koha-foreach --enabled /usr/share/koha/bin/cronjobs/holds/cancel_expired_holds.pl >/dev/null 2>&1 koha-foreach --enabled /usr/share/koha/bin/cronjobs/services_throttle.pl > /dev/null 2>&1 koha-foreach --enabled /usr/share/koha/bin/cronjobs/cleanup_database.pl --sessions --zebraqueue 10 --list-invites koha-foreach --enabled --noemail /usr/share/koha/bin/cronjobs/cleanup_database.pl --mail koha-foreach --enabled /usr/share/koha/bin/cronjobs/holds/auto_unsuspend_holds.pl > /dev/null 2>&1 koha-run-backups --days 2 --output /var/spool/koha $ cat /etc/cron.d/koha-common # /etc/cron.d/koha-common # # Call koha-rebuild-zebra for each enabled Koha instance, to make sure the # Zebra indexes are up to date. SHELL=/bin/sh PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin # Uncomment the following line if you do not want to use the koha-index-daemon integration # */5 * * * * root test -x /usr/sbin/koha-rebuild-zebra && koha-rebuild-zebra -q $(koha-list --enabled) */15 * * * * root koha-foreach --enabled --email /usr/share/koha/bin/cronjobs/process_message_queue.pl $ cat /etc/cron.hourly/koha-common #!/bin/sh # /etc/cron.hourly/koha-common -- Hourly housekeeping tasks for all Kohas. # Copyright 2010 Catalyst IT, Ltd koha-foreach --enabled /usr/share/koha/bin/cronjobs/holds/build_holds_queue.pl $ cat /etc/cron.monthly/koha-common #!/bin/sh # /etc/cron.monthly/koha-common -- Monthly housekeeping tasks for all Kohas. # Copyright 2015 Biblibre koha-foreach --enabled /usr/share/koha/bin/cronjobs/share_usage_with_koha_community.pl
Excerpts from Steve Nickerson's message of 2017-02-20 23:28:51 -0500:
Thank you Mark! As it turns out apparently my issue was that 'cron' was installed but not 'anacron'. I had those same /etc/cron.d, /etc/cron.daily, etc. files that you provided, but anacron wasn't installed/running, so they weren't being used. As soon as I added anacron things seem to be working now. Maybe anacron should be one of the dependencies for the koha-common package???
I'm not sure I understand why anacron was required. On both of the installations I'm using, anacron was either not installed (Debian 8 on Linode) or I had to disable it (Debian 8 in a VM on my laptop). Anacron caused problems for me (and others) with Zebra being killed off every morning. See these discussions: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16885 https://lists.katipo.co.nz/pipermail/koha/2016-September/046167.html
I wrote:
I'm not sure I understand why anacron was required.
Looking at this some more, could it be that your server isn't running continuously? The reason I ask is that the file /etc/crontab on Debian 8 looks like this: 17 * * * * root cd / && run-parts --report /etc/cron.hourly 25 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily ) 47 6 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly ) 52 6 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly ) I believe this means that if your machine isn't running at these times, and anacron isn't available, the cron jobs won't run. In particular, it appears that the daily, weekly, and monthly jobs are run between 6:25 and 6:52 AM. Anacron is useful for personal machines that don't run continuously, but it doesn't play well with Koha, in my experience.
The server on all the time, but the problem was that /usr/sbin/anacron didn't exist so the jobs were never kicking off because of the "test -x /usr/sbin/anacron" was of course not finding anacron. -----Original Message----- From: Mark Alexander [mailto:marka@pobox.com] Sent: Tuesday, February 21, 2017 9:57 AM To: koha <koha@lists.katipo.co.nz> Cc: Steve Nickerson <stevenanickerson@gmail.com> Subject: RE: [Koha] cron issue with Koha on Ubuntu I wrote:
I'm not sure I understand why anacron was required.
Looking at this some more, could it be that your server isn't running continuously? The reason I ask is that the file /etc/crontab on Debian 8 looks like this: 17 * * * * root cd / && run-parts --report /etc/cron.hourly 25 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily ) 47 6 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly ) 52 6 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly ) I believe this means that if your machine isn't running at these times, and anacron isn't available, the cron jobs won't run. In particular, it appears that the daily, weekly, and monthly jobs are run between 6:25 and 6:52 AM. Anacron is useful for personal machines that don't run continuously, but it doesn't play well with Koha, in my experience.
Excerpts from Steve Nickerson's message of 2017-02-21 12:04:10 -0500:
The server on all the time, but the problem was that /usr/sbin/anacron didn't exist so the jobs were never kicking off because of the "test -x /usr/sbin/anacron" was of course not finding anacron.
That is surprising. If anacron isn't present, the normal cron takes over via run-parts, as for example:
25 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
In other words, it should be possible to run your cron jobs without anacron. There must be something else missing. Maybe the cron daemon hasn't been started; you can see if it is running using: ps auxfw | egrep cron Or maybe it hasn't been installed; this can be checked using: dpkg -S /usr/sbin/cron or aptitude search "~i cron"
OK, so I dug further and do indeed find cron running and can see the jobs executing via /var/log/syslog. It appears that everything is working EXCEPT that the zebra indexing updates aren't working correctly. I see the line "Uncomment the following line if you do not want to use the koha-index-daemon integration" and the line following that is commented out...should it be? How do I know if I'm using the koha-index-daemon or not? As it stands right now items that are added do not show in search results and items removed continue to show, until I run a zebra rebuild manually. Thanks! Steve -----Original Message----- From: Mark Alexander [mailto:marka@pobox.com] Sent: Tuesday, February 21, 2017 1:58 PM To: Steve Nickerson <stevenanickerson@gmail.com> Cc: koha <koha@lists.katipo.co.nz> Subject: RE: [Koha] cron issue with Koha on Ubuntu Excerpts from Steve Nickerson's message of 2017-02-21 12:04:10 -0500:
The server on all the time, but the problem was that /usr/sbin/anacron didn't exist so the jobs were never kicking off because of the "test -x /usr/sbin/anacron" was of course not finding anacron.
That is surprising. If anacron isn't present, the normal cron takes over via run-parts, as for example:
25 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
In other words, it should be possible to run your cron jobs without anacron. There must be something else missing. Maybe the cron daemon hasn't been started; you can see if it is running using: ps auxfw | egrep cron Or maybe it hasn't been installed; this can be checked using: dpkg -S /usr/sbin/cron or aptitude search "~i cron"
Excerpts from Steve Nickerson's message of 2017-02-23 09:15:26 -0500:
OK, so I dug further and do indeed find cron running and can see the jobs executing via /var/log/syslog. It appears that everything is working EXCEPT that the zebra indexing updates aren't working correctly. I see the line "Uncomment the following line if you do not want to use the koha-index-daemon integration" and the line following that is commented out...should it be?
My fairly stock installation has that line commented out.
How do I know if I'm using the koha-index-daemon or not?
Maybe the daemon didn't get started for some reason. Check using this: ps auxfw | egrep zebra You should see four processes related to the two zebra daemons (one daemon for the indexer and one for the server). It's possible that the daemons didn't get started for some reason; they should have been started by /etc/init.d/koha-common. But you could try using this: koha-start-zebra <instancename> koha-indexer --start <instancename>
Check /etc/defaults/koha-common for the USE_INDEXER option. If you are carrying that file from old upgrades it might be disabled. If it is enabled, service koha-common restart should take care El jue., 23 de feb. de 2017 11:36 AM, Mark Alexander <marka@pobox.com> escribió:
Excerpts from Steve Nickerson's message of 2017-02-23 09:15:26 -0500:
OK, so I dug further and do indeed find cron running and can see the jobs executing via /var/log/syslog. It appears that everything is working EXCEPT that the zebra indexing updates aren't working correctly. I see the line "Uncomment the following line if you do not want to use the koha-index-daemon integration" and the line following that is commented out...should it be?
My fairly stock installation has that line commented out.
How do I know if I'm using the koha-index-daemon or not?
Maybe the daemon didn't get started for some reason. Check using this:
ps auxfw | egrep zebra
You should see four processes related to the two zebra daemons (one daemon for the indexer and one for the server). It's possible that the daemons didn't get started for some reason; they should have been started by /etc/init.d/koha-common. But you could try using this:
koha-start-zebra <instancename> koha-indexer --start <instancename> _______________________________________________ Koha mailing list http://koha-community.org Koha@lists.katipo.co.nz https://lists.katipo.co.nz/mailman/listinfo/koha
-- Tomás Cohen Arazi Theke Solutions (https://theke.io <http://theke.io/>) ✆ +54 9351 3513384 GPG: B2F3C15F
participants (3)
-
Mark Alexander -
Steve Nickerson -
Tomas Cohen Arazi