# Crontab语法说明

Crontab是用来定期执行程序的命令，您可以通过**设定时间参数**从而在固定时间、日期、间隔下，运行定期任务。

![](/files/iD2urtElQ1DvQFhun00R)

在crontab中，共有五个字段，每个参数字段代表一项时间设置（分钟，小时，日，月，周），五个字段共同表示一组时间，作为执行自动化工作流的时间表。当参数设定完成之后，便会按照您设置的时间表自动运行您的工作流。

```
# Crontab格式如下：
    *    *    *    *    *
    -    -    -    -    -
    |    |    |    |    |
    |    |    |    |    +----- 一周中的第几天 (0 - 7) (Sunday=0 or 7) 
    |    |    |    +---------- 月份 (1 - 12)
    |    |    +--------------- 一个月中的第几日 (1 - 31)
    |    +-------------------- 小时 (0 - 23)
    +------------------------- 分钟 (0 - 59)
    
# 例子：
    0 0 1 * *       # 每个月的1号
    10 6 * * 1-5    # 每周一到周五的早上6点10分
```

您也可以通过下列网址，进入crontab在线编辑器，获取更多cron语法和转译示例。

{% embed url="<https://crontab.guru>" %}


---

# 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://docs.graviti.cn/guide/tensorbay/action/schedule-crontab.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.
