在一组 cron 作业完成后运行一个 cron 作业?



我知道如何从这个接一个地运行一个cron作业:https://askubuntu.com/questions/923260/cron-run-a-script-after-the-other

但是,如果我有作业 A、B 和 C,如何让作业 C 等待 A 和 B 完成?A 或 B 可以先完成,C 在 A 和 B 都完成之前无法开始运行。

我会把整个事情放到一个脚本中,并使用标准的流程管理,比如:

#!/bin/env bash
jobA &  # start A in the background.
jobB    # start B in the foreground, A and B running.
wait    # B now finished, wait for A if necessary.
jobC    # A and B now finished, do C.

最新更新