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?
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,