Re: [Koha] Zebra not updating biblios au tomatically in koha 3.8
At 01:06 PM 9/4/2012 -0300, Tomas Cohen Arazi wrote:
On Tue, Sep 4, 2012 at 1:01 PM, Paul <paul.a@aandc.org> wrote: [snip]
KOHA_CONF=/etc/koha/koha-conf.xml KOHAPATH=/usr/share/koha PERL5LIB=$KOHAPATH/lib */1 * * * * koha $KOHAPATH/bin/migration_tools/rebuild_zebra.pl -a -b -z &> /dev/null [snip] and the cron rebuild_zebra.pl -a -b -z fails [Can't locate C4/Context.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .) at /usr/share/koha/bin/migration_tools/rebuild_zebra.pl line 6. BEGIN failed--compilation aborted at /usr/share/koha/bin/migration_tools/rebuild_zebra.pl line 6.]
That's correct. A shell like bash needs those variables defined in its scope to have them available. The scope of those variables defined in the crontab includes JUST the commands run from the crontab (think of it as a shell itself).
I appreciate the theory that /etc/cron.d/koha (as I quoted it above) should|could|would pick up the variables KOHA_CONF, KOHAPATH and PERL5LIB In fact I think this worked for Koha 3.6.7 on Ubuntu 12.04 *i386* (from my notes, no errors; but that install has been trashed) -- but it does NOT work on either of our two 64 bit servers -- hence the need to add the 'export' lines to /home/koha.bashrc and make them available *before* the cron job is called. I have not had time to find out *why* the 32- and 64-bit builds possibly differ and satisfy my curiosity. All I've done is come up with a working solution and share it with this community -- with the caveat that YMMV and there might well be other [more elegant?] ways around it. Best - Paul
Paul wrote:
I have not had time to find out *why* the 32- and 64-bit builds possibly differ and satisfy my curiosity. All I've done is come up with a working solution and share it with this community -- with the caveat that YMMV and there might well be other [more elegant?] ways around it.
Does this vary between cron packages, I wonder? After all, cron is not one thing... I'm not sure if cron is in any of the standards (maybe POSIX or LSB if anything) and even if it is, I doubt that goes as far as specifying environment handling. But I could be wrong. Anyway, there's lots of different ways to skin that particular cat... sorry, I mean skin that particular cron... and some cron software is better than others for different situations (for example, Anacron). Just guessing, -- MJ Ray (slef), member of www.software.coop, a for-more-than-profit co-op. http://koha-community.org supporter, web and library systems developer. In My Opinion Only: see http://mjr.towers.org.uk/email.html Available for hire (including development) at http://www.software.coop/
participants (2)
-
MJ Ray -
Paul