0

In my server, I have scheduled following set of cron files.

00 21 * * * /bin/sh /path/db_backup.sh
*/2 * * * * /usr/bin/php /path/file1.php
*/2 * * * * /usr/bin/php /path/file2.php
...
*/2 * * * * /usr/bin/php /path/file7.php
*/2 * * * * /usr/bin/php /path/file8.php

All the cron files are working on time. But last two php files 7 and 8 are not running.

Whether it's skipped due to previous crons tooks too time or any other reason behinds ?

Please help me to resolve this issue. Thanks in advance.

Tamilvanan
  • 103
  • 2

1 Answers1

0

The reason of the fail is highly depends on your cronjobs sheduler.

Anyway, try to move them to single (shell)script somewhere in /usr/local/bin and call it instead.

  • If I am creating the one sh file and putting all cron files into that and scheduling that sh file into crontab. While cron execution whether PHP files runs one by one or at the same time? – Tamilvanan Mar 20 '17 at 12:21
  • Depends how do you wrote the script: if you placed php-scripts there line by line, or divided them by `;`, then they wil be executed one by one irrelevant to exit status. If you divided them by `&&`, then every next one will run only if previous wasn't fail (i.e. exited with code 0). If you, finally, added `&` after each command, then they will be executed in parallel. – Vadim A. Misbakh-Soloviov Mar 20 '17 at 16:06