ashishdevre
ashishdevre

Reputation: 51

(shell script - qsub) wait for submitted job to complete before next command

My shell script involves qsub job submission and then copying the file generated by that job to some other location. How does one do that?

Here is how my shell script looks like:

...
qsub synplify.csh
cp ./rev_1/netlist.vqm ~/sample
...

Here, synplify.csh job is submitted on server but not completed. And it clears way to execute second line. Thus second line is executed while first job is being processed. I want second line to be executed after the job is completed.

Upvotes: 3

Views: 2706

Answers (2)

teichert
teichert

Reputation: 4723

Use -sync y the option.

qsub -sync y synplify.csh
cp ./rev_1/netlist.vqm ~/sample

From the man page:

-sync y causes qsub to wait for the job to complete before exiting.

Upvotes: 3

Related Questions