# Cron 表达式

CRON表达式是一个字符串，包含五个到七个由空格分隔的字段（每种软件不一样），表示一组时间，通常作为执行某个程序的时间表。 提示：本项目默认使用北京时间 环境变量TZ=Asia/Shanghai

测试有效性的网站 默认Linux模式适合顶点使用 Crontab执行时间计算 <https://tool.lu/crontab> ←点击可访问 带7步计算 三种类型 Crontab执行时间计算 <https://www.matools.com/crontab> ←点击可访问 带60步计算 自定义开始 Crontab执行时间计算 <https://tooltt.com/crontab> ←点击可访问 带9999步计算 大量案例参考

图解说明: 五位模式：分 时 日 月 周 对应自然值的范围 0-59分 0-23时 1-31日 1-12月 1-7星期 每个位置写上特定的字符表示功能：&#x20;

```
N 确定准确值 1 2 3 4 5
* 自然值开始 0或者1开始，有效范围内的数值都会被启用。60个分、24个时等
, 多个准确值 1,3,5,17,19
- 设定范围值 2-8 16-23 8-31
/ 间隔值开始 /1 /5

  可以多组合
```

默认每分钟：

```
* * * * * 
```

间隔5分钟：

```
*/5 * * * *
```

表达式案例： 标题和解释 相反义 Crontab表达式的特点

间隔N小时的准确分钟： 分钟位置准确 0点开始间隔小时

```
18 */3 * * *
30 */4 * * *
45 */6 * * *
```

间隔N小时内间隔N分钟： 0分钟开始间隔分钟 0时钟开始间隔小时

```
*/6 */3 * * *
*/15 */4 * * *
*/20 */6 * * *
```

时钟范围内的每分钟： 每分钟 在时钟范围内

```
* 9-17 * * *
* 8-20 * * *
* 0-7 * * *
```

范围时钟内间隔 又 范围分钟内间隔： 特定分钟开始间隔分钟 特定时钟开始间隔小时

```
10-50/1 1-20/1 * * *
20-40/3 2-10/3 * * *
30-50/6 0-23/6 * * *
```

指定星期的时分： 固定分钟 固定时钟 每周一三五

```
30 12 * * 1,3,5
```

每周指定星期几 又 在当日指定时钟 又 在当时指定分钟： 指定两个分钟 指定两个时钟然后范围内时钟 指定每周一到周三然后周五

```
15,45 9,15,18-21 * * 1-3,5
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://wiki.vertex-app.top/qi-ta/cron-biao-da-shi.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
