Unix cron job - executing informix 4GL process

Unix cron job - executing informix 4GL process

Post by yy4 via DB » Tue, 27 Jun 2006 18:16:25


I am facing some problem while executing the process thru cron. My execution
scripts (KORN shell) will be something as below:

echo U$(tput kf9)$(tput kf9)|/prog/bin/prog1.exe M A 1>/prog/log/cron.log

In my cron.log, I can see that the 1st input parameters is not passing in to
the program correctly therefore it is prompting invalid entry. However, when
I execute the program manually thru command line,it is working fine.

Anyone have any clue what cause the problem?


/prog/log/cron.log details:
---------------------------
ENTRY TO CREATE THE IMP AND LOG ACCOUNTS "ADD" FILE, ENTER 'A' O
R TO CREATE THE IMP AND LOG ACCOUNTS "UPDATE" FILE, ENTER 'U' OR TO PREPAR
E THE "ADD" OR "UPDATE" FILE FOR FTP TRANSMISSION, ENTER 'S' ENTER YOUR
CHOICE..
. (A/U/S) prog.exe/01 A. A. A. DATE 26/06/2006 VERSION 6.7.00 CREATE/SAVE
IMP
/LOG FILE FOR IBS F7 CANCEL / F9 ACCEPT ^HU^HH^H Invalid entry
Invalid entry Invalid entry
Invali
d entry Invalid entry

--
Message posted via DBMonster.com
http://www.yqcomputer.com/
 
 
 

Unix cron job - executing informix 4GL process

Post by Scott O'Ro » Tue, 27 Jun 2006 20:09:10

Which OS?

cron usually executes scripts with a Bourne shell (you'll get a warning after running crotab -e), unless you explicitly add something like #!/bin/ksh as the first line of your script.

-----Original Message-----
From: XXXX@XXXXX.COM
[mailto: XXXX@XXXXX.COM ]On Behalf Of yy4 via
DBMonster.com
Sent: 26 June 2006 10:16
To: XXXX@XXXXX.COM
Subject: Unix cron job - executing informix 4GL process


I am facing some problem while executing the process thru cron. My execution
scripts (KORN shell) will be something as below:

echo U$(tput kf9)$(tput kf9)|/prog/bin/prog1.exe M A 1>/prog/log/cron.log

In my cron.log, I can see that the 1st input parameters is not passing in to
the program correctly therefore it is prompting invalid entry. However, when
I execute the program manually thru command line,it is working fine.

Anyone have any clue what cause the problem?


/prog/log/cron.log details:
---------------------------
ENTRY TO CREATE THE IMP AND LOG ACCOUNTS "ADD" FILE, ENTER 'A' O
R TO CREATE THE IMP AND LOG ACCOUNTS "UPDATE" FILE, ENTER 'U' OR TO PREPAR
E THE "ADD" OR "UPDATE" FILE FOR FTP TRANSMISSION, ENTER 'S' ENTER YOUR
CHOICE..
.. (A/U/S) prog.exe/01 A. A. A. DATE 26/06/2006 VERSION 6.7.00 CREATE/SAVE
IMP
/LOG FILE FOR IBS F7 CANCEL / F9 ACCEPT ^HU^HH^H Invalid entry
Invalid entry Invalid entry
Invali
d entry Invalid entry

--
Message posted via DBMonster.com
http://www.yqcomputer.com/
_______________________________________________
Informix-list mailing list
XXXX@XXXXX.COM
http://www.yqcomputer.com/

 
 
 

Unix cron job - executing informix 4GL process

Post by Adam Tauno » Tue, 27 Jun 2006 20:41:27

> I am facing some problem while executing the process thru cron. My execution

When you execute it manually via a telnet/ssh session you probably have
a TERM value set, which defines that `tput kf9` outputs. When it runs
via CRON then TERM is possibly not set or set to some system default.

Try -
(export TERM=vt100; echo U$(tput kf9)$(tput kf9)|/prog/bin/prog1.exe M
A) >/prog/log/cron.log
 
 
 

Unix cron job - executing informix 4GL process

Post by Rob Koniko » Wed, 28 Jun 2006 04:24:09


It also looks like it is looking for a parameter/switch.

When executing from cron, you must specify all aspects of the operating
environment. Cron doesn't know much about anything if you don't tell him.

Rob


-----Original Message-----
From: XXXX@XXXXX.COM [mailto: XXXX@XXXXX.COM ]
On Behalf Of Scott O'Rourke
Sent: Monday, June 26, 2006 7:09 AM
To: yy4 via DBMonster.com; XXXX@XXXXX.COM
Subject: RE: Unix cron job - executing informix 4GL process

Which OS?

cron usually executes scripts with a Bourne shell (you'll get a warning
after running crotab -e), unless you explicitly add something like
#!/bin/ksh as the first line of your script.

-----Original Message-----
From: XXXX@XXXXX.COM
[mailto: XXXX@XXXXX.COM ]On Behalf Of yy4 via
DBMonster.com
Sent: 26 June 2006 10:16
To: XXXX@XXXXX.COM
Subject: Unix cron job - executing informix 4GL process


I am facing some problem while executing the process thru cron. My
execution
scripts (KORN shell) will be something as below:

echo U$(tput kf9)$(tput kf9)|/prog/bin/prog1.exe M A 1>/prog/log/cron.log

In my cron.log, I can see that the 1st input parameters is not passing in to
the program correctly therefore it is prompting invalid entry. However, when
I execute the program manually thru command line,it is working fine.

Anyone have any clue what cause the problem?


/prog/log/cron.log details:
---------------------------
ENTRY TO CREATE THE IMP AND LOG ACCOUNTS "ADD" FILE, ENTER 'A' O
R TO CREATE THE IMP AND LOG ACCOUNTS "UPDATE" FILE, ENTER 'U' OR TO PREPAR
E THE "ADD" OR "UPDATE" FILE FOR FTP TRANSMISSION, ENTER 'S' ENTER YOUR
CHOICE..
. (A/U/S) prog.exe/01 A. A. A. DATE 26/06/2006 VERSION 6.7.00 CREATE/SAVE
IMP
/LOG FILE FOR IBS F7 CANCEL / F9 ACCEPT ^HU^HH^H Invalid entry
Invalid entry Invalid entry
Invali
d entry Invalid entry

--
Message posted via DBMonster.com
http://www.yqcomputer.com/
_______________________________________________
Informix-list mailing list
XXXX@XXXXX.COM
http://www.yqcomputer.com/
_______________________________________________
Informix-list mailing list
XXXX@XXXXX.COM
http://www.yqcomputer.com/
 
 
 

Unix cron job - executing informix 4GL process

Post by yy4 via DB » Thu, 29 Jun 2006 10:36:59


Thank you for your response.
we are using TERM=wy150. I have checked that and it is exported correctly.
Any other clue to resolve this issue?

--
Message posted via DBMonster.com
http://www.yqcomputer.com/
 
 
 

Unix cron job - executing informix 4GL process

Post by yy4 via DB » Thu, 29 Jun 2006 10:43:30


I am using UNIX-HP. In my scripts, the first line already stated #!
/usr/bin/ksh. Any other clue to resolve this?

--
Message posted via DBMonster.com
http://www.yqcomputer.com/
 
 
 

Unix cron job - executing informix 4GL process

Post by Jonathan L » Thu, 29 Jun 2006 14:14:18


Problems with running Informix programs via cron almost invariably boil
down to environment in some extended sense of the term environment.
Here, that could include current directory, uid, gid, aux gid, umask,
tty device, and so on - as well as the environment variables.

First step - analyze what environment variables are set in the working
environment, from the command line.
Second step - establish what environment variables are set in the cron
environment.
If the problem isn't obvious when you compare the two lists, then try
eliminating variables from the command line environment, heading towards
the simpler cron environment.

If you get to identical environments and the problem still occurs, look
at other aspects of the environment, such as uid, ...
If you still have problems after reconciling all the environment, it is
most likely something to do with the terminal handling - and the tty.
Do ensure that you get the correct output from your echo command - pipe
it through tee perhaps, to trap the output before sending it to the program.

--
Jonathan Leffler #include <disclaimer.h>
Email: XXXX@XXXXX.COM , XXXX@XXXXX.COM
Guardian of DBD::Informix v2005.02 -- http://www.yqcomputer.com/
 
 
 

Unix cron job - executing informix 4GL process

Post by yy4 via DB » Thu, 29 Jun 2006 18:32:42

Further analysis done, it is comfirm that the cause was due to the $(tput kf9)
not pass to the calling 4GL program correctly.

after a crontab log showing the following:
stty: : Not a typewriter

Any idea to resolve this?
It seem like the cron process can't recognize the $(tput kf9) correctly.
I am not the unix expert, but you please show me how to handle all these tput
command and terminal setting handling especially in cron process.




--
Message posted via DBMonster.com
http://www.yqcomputer.com/
 
 
 

Unix cron job - executing informix 4GL process

Post by Mike Aubur » Thu, 29 Jun 2006 18:44:58

Just put it all in a script and run that script from cron instead...




--
Mike Aubury