Skip to content
Advertisement

CentOS Unix Cron order of execution when all set to same time

I have a series of cron jobs running at the command line calling the php interpreter all by the same user configured to run once a day

0   0   *   *   *   /usr/bin/php -q /mydirectory/myphp.php
0   0   *   *   *   /usr/bin/php -q /mydirectory/myphp2.php
0   0   *   *   *   /usr/bin/php -q /mydirectory/myphp3.php

Do these all execute at once or do the execute in the order of entry in some cron table, complete and move on to the next cron job?

Advertisement

Answer

And to answer your question despite the off-topic:

They will get executed in parallel, not sequentially. If you need some order it would pay to add them all to one script, and execute them sequentially separated by &&, e.g.

#!/bin/bash
/usr/bin/php -q /mydirectory/myphp.php && /usr/bin/php -q /mydirectory/myphp2.php && /usr/bin/php -q /mydirectory/myphp3.php
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement