I am trying to run a series of jobs submitted to the cluster, one after the other, by suplpying the following .sh script:
Annotation_Loop.sh :
#!/bin/bash
job=`qsub run_IntersectBed_1.sh 0`
for i in {1..3}
do
job_next=`qsub -hold_jid $job run_IntersectBed_1.sh $i`
job=$job_next
done
The first job (before entering the loop) is executed, but the next ones are never started.
I think the script is well written. I change the mode to an executable and run it as
nohup ./Annotation_Loop.sh
(I think this is necessary?) ... but the rest is never done.
I tried -W before, using -W depend=afterok:$job
in place of -hold_jid $job
#!/bin/bash
job=`qsub run_IntersectBed_1.sh 0`
for i in {1..3}
do
job_next=`qsub -W depend=afterok:$job run_IntersectBed_1.sh $i`
job=$job_next
done
But it returned unknown option -W
.
What could be going wrong? :(