Chubaka
Chubaka

Reputation: 3155

gnu parallel no dependency between jobs in each division

Assuming we have the following GNU parallel command:

parallel --resume-failed --joblog test.log --jobs 2 -m -k sh ::: 1.sh 2.sh 3.sh

the first CPU: 1.sh 2.sh

the second CPU:3.sh

Right now if the 1.sh failed, the code will retry 1.sh. If 1.sh still failed, 2.ish won't be executed as well. I wonder if there is anyway that we run 2.sh first if 1.sh failed, and then re-try 1.sh at the end again? Thanks.

Upvotes: 1

Views: 209

Answers (1)

Ole Tange
Ole Tange

Reputation: 33715

I have the feeling you really do not want -m:

$ parallel --dryrun --resume-failed --joblog test.log --jobs 2 -m -k sh ::: 1.sh 2.sh 3.sh
sh 1.sh 2.sh
sh 3.sh

Is that really what you want run? I.e. having 2.sh as argument for 1.sh.

I reckon you want to run this instead:

$ parallel --joblog test.log --jobs 2 -k sh ::: 1.sh 2.sh 3.sh

If any of these fails, you will resume the failed by:

$ parallel --resume-failed --joblog test.log --jobs 2 -k sh ::: 1.sh 2.sh 3.sh

Upvotes: 1

Related Questions