htdig: About the Cron Jobs


Majeau, Benoit (Benoit.Majeau@nrc.ca)
Thu, 3 Dec 1998 15:41:24 -0500


Hi,

If you are experiencing problems to run "rundig" from a cron job (getting
some weird errors like "Word Sort Failed"), simply run the script from a
"csh" (C shell).

In other words, do these modifications in your rundig script.

1- Change the first line "#!/bin/sh" to this "#!/bin/csh"

2- Some "sh" commands do not work in the "csh". So we have to translate
them:

- An if statement is different. It looks like this:

                                if (expr) then
                                    cmds
                                endif

- To set an environment variable, the command to use is "setenv" and
not "export"

                        So this: TMPDIR = /path/tmp;
export TMPDIR
                        Would become this: setenv TMPDIR
/path/tmp

At least, it is working for me (I'm using linux).

Cheers,

Benoit

P.S .: Thanx to Lisa Applegate and Adam Crews for the help
P.S.S.: I have attached a sample of my script if you need some inspiration
;)
 <<rundig.txt>>

#!/bin/csh

#
# rundig
#
# $Id: rundig,v 1.3 1998/10/02 15:22:06 ghutchis Exp $
#
# This is a sample script to create a search database for ht://Dig.
#
# I don't use this:
#if [ "$1" = "-v" ]; then
# verbose=-v
#fi

#
# Set the TMPDIR variable if you want htmerge to put files in a location
# other than the default. This is important if you do not have enough
# disk space for the big sort that htmerge runs. Also, be aware that
# on some systems, /tmp is a memory mapped filesystem that takes away
# from virtual memory.
#
setenv TMPDIR /home2/htdig3.1.0b2/bin/tmp

setenv LOGFILE ./logs/dig-mysearchengine.log

setenv CONF /home2/htdig3.1.0b2/conf/dig-nrc-only.conf

/home2/htdig3.1.0b2/bin/htdig -v -s -c $CONF > $LOGFILE
/home2/htdig3.1.0b2/bin/htmerge -s -v -c $CONF >> $LOGFILE
/home2/htdig3.1.0b2/bin/htnotify -v -c $CONF >> $LOGFILE

#
# Only create the endings database if it doesn't already exist.
# This database is static, so even if pages change, this database will not
# need to be rebuilt.
#
if ( ! -f /home2/htdig3.1.0b2/common/word2root.db ) then
    /home2/htdig3.1.0b2/bin/htfuzzy -v endings >> $LOGFILE
endif

if ( ! -f /home2/htdig3.1.0b2/common/synonyms.db ) then
    /home2/htdig3.1.0b2/bin/htfuzzy -v synonyms >> $LOGFILE
endif

----------------------------------------------------------------------
To unsubscribe from the htdig mailing list, send a message to
htdig-request@sdsu.edu containing the single word "unsubscribe" in
the body of the message.



This archive was generated by hypermail 2.0b3 on Sat Jan 02 1999 - 16:29:46 PST