dbload command didn't run in shell script on crontab
Posted in 2003
Topics: General Discussion
hello all,
I wrote a shell script that inserts data into tables via dbload command. =
when I run it manuelly it works fine, but in crontab (unixware 7), =
"dbload command not found" returns. I tried to write =
/usr/informix/bin/dbload .... in shell script but in that case some =
environmantal variables didn't found such as INFORMIXSERVER.
I try to run shell script on crontab as user xxx, not user informix.
Is there any idea?
thanks.
mustafa sert
=20
----LNX_Thu_May_15_2003_11:09:11_V3.33--
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
>Datum: 2003.05.15 10:37:43
>Sender: mustafa sert <msert@meteor.gov.tr>
>
>hello all,
>I wrote a shell script that inserts data into tables via dbload command.=
=3D
>when I run it manuelly it works fine, but in crontab (unixware 7), =3D
>"dbload command not found" returns. I tried to write =3D
>/usr/informix/bin/dbload .... in shell script but in that case some=3D
>environmantal variables didn't found such as INFORMIXSERVER.
>I try to run shell script on crontab as user xxx, not user informix.
>Is there any idea?
=
Common 'problem' with cron/at jobs: Jobs submitted by cron have only
a 'minimal' environment (PATH etc.) . No .login / .profile / .kshrc /.csh=
rc
is executed.
That means: You have to set all your environment explicitly in the script=
or better by sourcing some common scripts with these variables - for Info=
rmix
you need at least INFORMIXDIR and INFORMIXSERVER .
=
Regards
Andreas Kutsche
------------------------------------------------
SPAR Oesterreichische Warenhandels-AG
Hauptzentrale
Europastra=DFe 3
A-5015 Salzburg
=
Telefon : +43 662 4470 24423
E-Mail : Andreas.KUTSCHE@spar.at
Internet: http://www.spar.at
------------------------------------------------
=
----LNX_Thu_May_15_2003_11:09:11_V3.33----
Informix Environment is not setup for crontab job user xxx.
You should provide whatever Informix Environment variables defined in your
.profile to the crontab job user. Then it works.
Informix recommended to keep Informix Environment setup variables in one
file. The file name called like ifmxset.env.
This file can call either at user .profile or in shell script for Informix
Environment to that session.
. {PATH}/ifmxset.env
Ravi
-----Original Message-----
From: mustafa sert [mailto:msert@meteor.gov.tr]
Sent: Thursday, May 15, 2003 2:34 AM
To: ids@iiug.org
Subject: dbload command didn't run in shell script on crontab [1146]
hello all,
I wrote a shell script that inserts data into tables via dbload command. =
when I run it manuelly it works fine, but in crontab (unixware 7), = "dbload
command not found" returns. I tried to write = /usr/informix/bin/dbload ....
in shell script but in that case some = environmantal variables didn't found
such as INFORMIXSERVER. I try to run shell script on crontab as user xxx,
not user informix. Is there any idea? thanks. mustafa sert
=20