I have a cron entry that gets stuck which I cannot break out of. The cron job launches a script which runs our nightly jobs for our application system. The script submits asynchronous jobs in the job scheduler of our application system. We have a few steps that require waiting for completion before going on to the next job. To control that, we test the return code from the app server. If the status of the job is greater than 59, it's still running. Hence the following code (there is no "getjobstatus" command, but assume it returns a numeric value to jobstatus below):
jobstatus=0
while [[ $jobstatus -lt 60 ]]
do
sleep 5
jobstatus=`getstatus whatever`
done
I've tried to kill the "sleep" process but it keeps coming back. How do I prevent that and kill it for good?
$?
– thrig Aug 21 '17 at 19:55sleep 5
(or possiblyjobstatus=$(getstatus whatever)
) process. – Deathgrip Aug 21 '17 at 19:55