I am trying to run a program multiple times (a different copy of the executable is located in several different directories, and I am trying to get them all run). I can not run them at the same time because each individual execution uses almost all of the computer's active available RAM. The program takes several hours to run each time, and also reads input arguments from a separate text file and raw image data from separate files as well. Is there a way to automate running the executables sequentially, so that once one is done running it will run the next one in another directory?
Asked
Active
Viewed 414 times
1
-
use `;` between commands. – Eugene Sh. Jun 04 '18 at 21:24
-
Will this work when I am trying to run executables in different directories? – Asef Islam Jun 05 '18 at 17:57
1 Answers
2
Use ; between your commands to run one after another.
You can also create a 'service' and control it via systemctl
and journalctl
commands (In case you are afraid of system goes down). See this for example: link
(It is applicable for all types of binaries as well as shell scripts)
Another reference: https://medium.com/@benmorel/creating-a-linux-service-with-systemd-611b5c8b91d6
-
What if the executables are in different directories? Is there a way to use ; with different directories? – Asef Islam Jun 05 '18 at 17:58
-
Yes; for example: `~/a.sh;~/myfolder/b.sh;` You can supply the absolute or relative path of your binaries to execute. @AsefIslam – Saleh Jun 05 '18 at 22:16