RE: Informix Cron Job
Posted in 1998
Guido Conrad wrote:
> If that's all in your cronfile, I'm absolutely sure, zhat it won't =
work.
> INFORMIX never runs without the proper environment, which must contain =
at
> least a valid INFORMIXDIR and INFORMIXSERVER.
> cron is started at system boot time, which means. that it has it's own
> (crippled) environment, which includes a minimum of PATH, TIMEZONE and =
I
> guess a USER or LOGNAME root. It might be possible to add a
> PATH=3D$PATH:$INFORMIXDIR/bin ; export PATH to your shell script.>
In these instances I usually use cron to execute a script, that has a =
couple of lines like:
if [ -z "$INFORMIXSERVER" ]
then
echo "Running under cron - setting environment"
. /usr/local/bin/set_db_env.sh
fi
# Run the various tasks
dbaccess .....
That way it doesn't matter whether you execute from the command line or =
via cron, it will set the environment for you if it can't find one of the =
crucial Informix environment variables. This works under sh and ksh. =
Your script uses csh but I imagine you can do something similar.
HTH
RET
>
> 0410168790-0001@t-online.de schrieb im Beitrag
> <6hpu46$dj6$1@news02.btx.dtag.de>...
> > norli <norli@asiapac.net> schreibt: > Hi all,
> > >
> > > Is there a way I can schedule some processes:
> > >
> > > 1. update table, on UNIX, via cron job?
> > >
> > > I created a cron under user informix to update a table monthly. My
cron
> > > entry:
> > >
> > > 1 0 1 * * /export/home/intranet/leave_app/annual_update >/dev/null =
2>&1
> > >
> > > My annual_update file:
> > >
> > > #!/bin/csh
> > >
> > > cd /export/home/users/norli/leave_app
> > >
> > > dbaccess intranet annual_update.sql
> > >
> > >
> > > My annual_update.sql file:
> > >
> > > #!/bin/csh
> > >
> > > update employee set annual=3Dannual+1
+------------------------------------------+
| Richard Thomas |
| DBA - Marketing Information Systems |
| Optus IT |
| email: richard_thomas@yes.optus.com.au |
| Ph: +61 2 9342 7188 |
| "My opinions are my opinions" |
+------------------------------------------+