Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个 crontab 行来执行 2 个这样的任务:
0 3 * * * java -jar somthing.jar && java -jar something2.jar
我的问题是,当第一个任务有异常时,第二个任务没有运行。我想在第一个任务完成或出现异常后运行第二个任务。
我认为你使用;而不是&&
;
&&
在你的情况下:
0 3 * * * java -jar something.jar ; java -jar something2.jar