Skip to main content.
home | support | download

Back to List Archive

Re: Error running swish-e as cron job

From: Greg Fenton <greg_fenton(at)not-real.yahoo.com>
Date: Wed Apr 14 2004 - 16:04:22 GMT
--- Jody Cleveland <Cleveland@winnefox.org> wrote:
> 
> Right now, I've got 4 separate cron jobs, one for each site I have.
> Is there a way to write a script that will do multiple indexes? Or,
do I
> need a separate one for each site I index?


In a single shell script, you can call swish-e multiple times:


----------------------------------------------------------
#!/bin/bash

MAILTO="address_to_email_on_error@mydomain.com"
PERL5LIB="$PERL5LIB:/usr/local/my_swish_install/lib/perl5"
PATH="$PATH:/usr/local/my_swish_install/bin"

cd /path/to/search1/dir
swish-e -c search1.conf -S prog

cd /path/to/search2/dir
swish-e -c search2.conf -S fs

cd /path/to/search3/dir
swish-e -c search3.conf -S prog
----------------------------------------------------------

Then you simply call this shell script from your cron job.

Of course, you'd want to have tests in there to handle errors.  For
example, you might put the following code right after each call to
swish-e:

   if [ $? != 0 ];
   then
       echo "I got an error!"
       exit 1
   fi

Hope this helps,
greg_fenton.

=====
Greg Fenton
greg_fenton@yahoo.com


	
		
__________________________________
Do you Yahoo!?
Yahoo! Tax Center - File online by April 15th
http://taxes.yahoo.com/filing.html
Received on Wed Apr 14 09:04:22 2004