I'm having an issue with the job-scheduling when I start a job via shell and I'm hoping somebody can give me some tips or had this issue before:
I'm changing the server from Solaris to Linux.
On solaris a job was started in the following way:
Job = IMPORT_DATA
Use external Sched = No
Periodical = Yes
Suspend Job Until Next Execution = Yes
Period = 1 Minute
Next Execution Date = a date/time in the future
Status = Free
Now to start the job and let it run forever we used the shell script
root> su - job100
job100> $BSE/rc.startjob_job100 import_data
(Note: In this script the job is started via the session ttaad5203m000)
The job started, was then shortly in the state "Running" and then updated the last and next runtime and was in the state "Waiting" for the next minute, cause this is the given period for this job.
And the job ran every minute and in between it was in the "Waiting" state. Everything was as expected.
Now on the new Linux server the job runs once, updates the times, then is in the state "Waiting" but runs never again!? It remains in "Waiting"- state forever.
This way to start a periodically job cannot longer be used in our new environment. But why?
I checked some logs and the processes but nothing unusual.
Shure we can set it up as job daemon but the question remains:
Why is this mechanism broken?
The help of the field "Suspend Job Until Next Execution" clearly states:
Indicates whether the periodical job must be executed automatically after last execution. After execution of a periodical job, the next execution date is automatically updated according to the given period and/or calendar date.
If this check box is selected, the job is suspended until the next execution date. For jobs started by the Activate Job (ttaad5203m000) session, the UNIX shell program rc.startjob, or the Windows batch file startjob.bat, the job’s status is set to Waiting. The job is automatically restarted at every next execution date that is defined in the calendar or by the interval.
If this check box is cleared, the job runs once and is then stopped. For jobs started by the Activate Job (ttaad5203m000) session, the UNIX shell program rc.startjob, or the Windows batch file startjob.bat, the job’s status is set to Free. To restart the job, you must manually start the Activate Job (ttaad5203m000) session, the UNIX shell program rc.startjob, or the Windows batch file startjob.bat.
Any suggestions where to find the bug. Why the running job- bshell doesn't start the job again at the next execution interval?
Out of curiosity I changed the field "Suspend Job Until Next Execution" from "Yes" to "No". Then I set the next running date in the near future. Then I started the job via the script.
Normaly it should execute the job at the given time, then it should set the job status to "Free" and update the next running time according to the interval and then exit the bshell.
But it also remains in the state "Waiting" and never executes anything. The bshell process never ends. !?!? Very curious...