wuyels
10th September 2002, 12:03
Hi,

We need using rc.startjob to automatic run a job,So,I make a Script to Run the rc.startjob.
After build script file,I test to Execute new build Script file in UNIX,It is ok(can write log to file and to activate job).Afterward, I seting the file to Cron,But occur below state:
1.0 can write log to specify log file.
2.0 can't execute to Activate job(Baan session ttaad5203m000 status still is 'Free').
I check the two file 'cron.deny'and 'cron.allow' is seting correct.
below is script code:
# Purpos
# Post Integration Transactions automatically (Every Day)
# Environment Variables #
BSE=/baan/baan4c4/bse
BSE_TMP=$BSE/tmp
ORACLE_HOME=/oracle/oracle8
ORACLE_SID=baan4c4
export BSE
export BSE_TMP
export ORACLE_HOME
export ORACLE_SID

# Execute BaaN Job #
/baan/home/batch/c430/rc.startjob PITG01

# Log Check #
/usr/bin/echo 'Check Date' >> /var/cron/log_bsp/log.dmp
/usr/bin/date >> /var/cron/log_bsp/log.dmp
/usr/bin/echo '-------------------------------------------' >>/var/cron/log_bsp/
log.dmp
#/usr/bin/grep "n't" /baan/home/bsp/tbldump/bkup/1_Mon/x_pre.err >> /var/cron/log_bsp/log.dmp
##########
Any suggestions are appreciated.
Thanks!
Wu

James
10th September 2002, 14:59
Try switching to a user that is a member of the bsp unix group before running rc.startjob. Otherwise this job will run as user cron.

e.g.
su - bsp -c "/baan/home/batch/c430/rc.startjob PITG01"

wuyels
10th September 2002, 17:43
Thanks James
We switching user to a user of the bsp member on before running rc.startjob. Afterwared,setting this job to run as user cron.But still occur same problem:Baan session ttaad5203m000 status still is 'Free'.

Wu

telgar
10th September 2002, 18:15
You do not need to use rc.startjob. what I have done is to create a .sh script as follows.


BSE=/software/baaniv/bse
BSE_TMP=/software/baaniv/bse/tmp
export BSE BSE_TMP
PATH=$BSE/bin:$PATH
export PATH
TERM=vt100
export TERM
USER=jobs
export USER
${BSE}/etc/rc.startjob EDI


once you have this in the correct path for your jobs, then in crontab -e you need to set the time and date for it to start as follows:


25 16 * * 1-5 /software/baaniv/bse/etc/JOBEDI.sh

Then make sure the job is set to free in Baan and you should have no more problems.

Just verify that your path is correct for where you have stored your shell scripts.

James
10th September 2002, 18:40
Isn't the status "Free" normal?
Check the Job History - you may find the job is indeed running ok.

telgar
10th September 2002, 18:54
The one session to show if the job is running currently as we all know is the session Cancel Jobs, if however the job is running and finishing quickly, you are right, you need to check Job History.

Francesco
10th September 2002, 19:15
Check the ownership of the rc.startjoberr in the TMP directory.
If whoever owns cron does not have write permissions to this file, the rc.startjob will fail.

wuyels
11th September 2002, 16:47
Now OK!!

Add the following script :
##########
TERM=vt100
export TERM
##########

Thanks for everyone's input!
Wu