首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Azure devops管道的cron语法格式不正确

Azure devops管道的cron语法格式不正确
EN

Stack Overflow用户
提问于 2021-10-22 16:40:36
回答 1查看 65关注 0票数 0

尝试在azure devops管道上设置cron,但我收到此错误消息。我看了文档,但不确定有什么不符合文档。有人能告诉我我的cron语法出了什么问题吗?谢谢。

代码语言:javascript
复制
Error while validating cron input. Improperly formed cron syntax: '0 21 * * 1-7'.

下面是整个yml文件。

代码语言:javascript
复制
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml

trigger:
  - master

schedules:
  - cron: "0 21 * * 1-7"
    displayName: "pipeline cron test"
    branches:
      include: 
      - master
    always: true



pool:
  vmImage: ubuntu-latest

steps:
  - script: echo Hello, world!
    displayName: Run a one-line script, changed

  - script: |
      echo Add other tasks to build, test, and deploy your project.
      echo See https://aka.ms/yaml
      echo more info
    displayName: 'Run a multi-line script'

以下是文档的相关部分。

代码语言:javascript
复制
Building Cron Syntax
Each cron syntax consists of 5 values separated by Space character:

1
2
3
4
5
6
mm HH DD MM DW
 \  \  \  \  \__ Days of week
  \  \  \  \____ Months
   \  \  \______ Days
    \  \________ Hours
     \__________ Minutes
We can use following table to create understand syntax:

Syntax  Meaning Accepted Values
mm  Minutes 0 to 59
DD  Hours   0 to 23
MM  Months  1 through 12, full English names, first three letters of English names
DW  Days of the Week    0 through 6 (starting with Sunday), full English names, first three letters of English names
Values can be provided in following formats:
 

Format  Example Description
Wildcard    *   Matches all values for this field
Single value    5   Specifies a single value for this field
Comma delimited 3,5,6   Specifies multiple values for this field. Multiple formats can be combined, like 1,3-6
Ranges  1-3 The inclusive range of values for this field
Intervals   */4 or 1-5/2    Intervals to match for this field, such as every 4th value or the range 1-5 with a step interval of 2
EN

回答 1

Stack Overflow用户

发布于 2021-10-24 11:52:10

如果您想在一周中的所有日子都触发CRON语法,您应该指定如下语法:“021** *”或“021** 0-6”。

周日星期:0至6(以

开头),英文全称,英文名前三个字母

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/69680405

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档