我想设置一个 cron 在另一个 cron 之后运行。例如:Cron A 在下午 01:00 结束,cron B 将在下午 01:01 开始。问题是我不知道 cron A 何时完成。
我检查了 crontab 语法。它不为此目的提供任何参数。
我的实际情况是:
# This cron must run first.
? ? * * * /usr/local/bin/php -f /path/select_and_print_to_log_file.php
# two these crons runs at the same time.
0 13 * * * /usr/local/bin/php -f /path/update_user.php
0 13 * * * /usr/local/bin/php -f /path/update_image.php
# This cron runs right after two above cron completes.
? ? * * * /usr/local/bin/php -f /path/select_and_print_to_log_file.php
最佳答案
您可以使用batch第一个 cron 中的命令安排第二个任务运行。
关于linux - Cron 在其他 cron 之后运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8921659/