如何每隔1小时10分钟运行一次cron作业

时间:2022-04-17 19:14:43

I did the following:

我做了以下事情:

0 */10 * * * {CMD}

but it worked until midnight and didn't continue the next day. Can someone please suggest something?

但它一直工作到午夜,第二天没有继续。有人可以建议吗?

1 个解决方案

#1


15  

Use this:

用这个:

10 * * * * {CMD}

which means start new job at 10 minutes of every hour: 1:10, 2:10, ...

这意味着每小时10分钟开始新工作:1:10,2:10,......

If you want to start at 1:10, 2:20, 3:30, ..., then you will need to write a lot of manual rules, each starting at those times (or write your own scheduler).

如果你想在1:10,2:20,3:30,...开始,那么你需要编写很多手动规则,每个规则从这些时间开始(或编写自己的调度程序)。

#1


15  

Use this:

用这个:

10 * * * * {CMD}

which means start new job at 10 minutes of every hour: 1:10, 2:10, ...

这意味着每小时10分钟开始新工作:1:10,2:10,......

If you want to start at 1:10, 2:20, 3:30, ..., then you will need to write a lot of manual rules, each starting at those times (or write your own scheduler).

如果你想在1:10,2:20,3:30,...开始,那么你需要编写很多手动规则,每个规则从这些时间开始(或编写自己的调度程序)。