RE: Informix CRONTAB problem
Posted in 2005
Looks like you maybe don't have your environment set. Cron does no
execute your .profile unless explicitely told to do so. Add it to your
script or add it to the cron entry.
Bill
> -----Original Message-----
> From: owner-informix-list@iiug.org [SMTP:owner-informix-list@iiug.org]
> On Behalf Of gary.cobden@nhs.net
> Sent: Wednesday, December 21, 2005 6: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 $i> done
>
> 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