In what order do cron jobs with the same schedule run?
Solution 1:
The order for Ubuntu is top-down but in parallel.
Meaning, for your example:
* * * * * /path/to/taskB * * * * * /path/to/taskC * * * * * /path/to/taskA
-
taskB
starts first, - then
taskC
without waiting fortaskB
to complete, - then
taskA
without waiting fortaskC
ortaskB
to complete
Ubuntu inherits this order from Debian. But in general this behavior may vary by Linux distribution/version and cron
implementation. You should not depend on it to be the same. For example, in FreeBSD, the order is bottom-up!
If the scripts depend on each other, best to call them in sequence, one from the other, or from a "master" wrapper script, which is the only one cron
actually executes.