Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am running some programs over a cluster and I would like to run them in a sequence, i.e when the first program terminates the second one starts and so on. This is so that my cluster does not exceed its bandwidth and its memory pool. Crontab is not what I am looking for because I do not know when the program finishes. Is there a way I can run my programs in this manner?

share|improve this question
How do you start your programs? E.g. on a non cluster you could do program1 ; program2 ; program3 to start three programs sequantially, or program1 && program2 to start program 2 after program1 has succesfully ended. ( && for success, || for failure). – Hennes Jan 6 '13 at 14:36
To add to @Hennes' response, one can use parentheses to group commands if the priorities are unhelpful - && is higher-priority than ||, which can be thought of as higher-priority than ;. – Darael Jan 6 '13 at 19:08

You could execute remote commands via SSH, where one of the server run as the central script execution. You can use key-based authentication. Below is an example of a script file, the script are executed one by one,

ssh root@MachineA 'bash -s' <
ssh root@MachineB 'bash -s' <
ssh root@MachineC 'bash -s' <
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.