RE: Informix CRONTAB problem
Posted in 2005
Just looking at it real quick I would say that you need to move up the
setting of your environment variables to the top of the script. I
believe that the onmode command will need these set as well as the
dbaccess.
Try that.
David Link
-----Original Message-----
From: owner-informix-list@iiug.org [mailto:owner-informix-list@iiug.org]
On Behalf Of gary.cobden@nhs.net
Sent: Wednesday, December 21, 2005 5:17 AM
To: informix-list@iiug.org
Subject: Informix CRONTAB problem
Morning all
I have a problem with the following script which is designed to run a
database export (dbexport) after cancelling all currently active
sessions. It runs fine when run interactively:-
cd /comwise343/etc/local
mv cs_top cs_top_old
cd /home/informix/bin
rm sids
dbaccess sysmaster <<!
output to sids without headings
select distinct (a.owner) from syslocks a, sysdatabases b
where a.rowidlk = b.rowid
and b.name = "comwise"!
for i in `cat sids`
do
onmode -z $idone
INFORMIXDIR=/usr/informix
export INFORMIXDIR
INFORMIXSERVER=ONLINELIVE
ONCONFIG=onconfig.live
PATH=$PATH:$INFORMIXDIR/bin
export INFORMIXSERVER ONCONFIG PATH
/usr/informix/bin/dbexport comwise -c -o /scratch/schema
cd /comwise343/etc/local
mv cs_top_old cs_top
However, when run via a crontab command, the job fails with some or all
of the following errors:-
dbaccess: not found.
cat: Cannot open sids: No such file or directory
-425 - Database is currently opened by another user.
-107 - ISAM error: record is locked.
Any ideas please?
I am aware that the last two errors relate to 'single user issues', but
the first set of commands in the script kill active sessions
interactively,and the script runs. So why not via CRONTAB
Help please.
Many thanks
Gary
sending to informix-list