...
Codeblock | ||
---|---|---|
| ||
# submit a first job, extract job id sbatch_output=$(sbatch job1.sbatch) jobid=${sbatch_output##* } # submit a second job with dependency: starts only if the previous job terminates successfully) sbatch_output=$(sbatch --dependency=afterok:$jobid job2.sbatch) jobid=${sbatch_output##* } # submit a third job with dependency: starts only if the previous job terminates successfully) sbatch_output=$(sbatch --dependency=afterok:$jobid job3.sbatch) |
...