0

I have the following problem about running a job in background, this is a backup job, I know TWS tells you not to run a job in background but in my scenario I have no other option but to run it in background, this is because I have a lot of scripts and used to run manually but now needs to automate and schedule with tws.

The idea I have is to create a job that validates the backup background job and waits until the background job is finished, only then it will continue its normal flow.

Any idea how to do it? or maybe TWS has an option to do this.

Thanks.

1 Answers1

0

basically TWS uses the $TWS_HOME/jobmanrc file as a wrapper to launch the script defined in a job, redirect script logs to TWS stdlist and handles the return code to manage dependencies with other jobs/schedules.

you can have a look at that jobmanrc file, it's pretty simple to read.

that said, if your background job is not launched using TWS, no chance to have it's return code managed by TWS. you can create a technical job running a script every n minutes to monitor your background job with an exit code >0 until it is running ( ps aux|grep && exit 1 ) and put a success dependency on your following schedules, but it's dirty.

fanthore
  • 11
  • 4