I have a situation where I run two commands (they go into background (nohup)), come back after 2 hours, and if both have completed, run two more commands (again nohup), again come back after 2 hours and run two more commands and so on..
I was wondering if it was possible for me to queue these up, so that after the first two finish, the next two start automatically, so that I don't need to keep checking every 2 hours?
All those are independent programs; they are simulations that are memory and CPU hungry, so I don't want more than two of them running simultaneously at any time.
I run them using a syntax similar to:
nohup mySimulator inputs1.txt nohup mySimulator inputs2.txt nohup mySimulator inputs3.txt [after the first two have completed, that is..]