尝试在azure devops管道上设置cron,但我收到此错误消息。我看了文档,但不确定有什么不符合文档。有人能告诉我我的cron语法出了什么问题吗?谢谢。
Error while validating cron input. Improperly formed cron syntax: '0 21 * * 1-7'.下面是整个yml文件。
# 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'以下是文档的相关部分。
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发布于 2021-10-24 11:52:10
如果您想在一周中的所有日子都触发CRON语法,您应该指定如下语法:“021** *”或“021** 0-6”。
周日星期:0至6(以
开头),英文全称,英文名前三个字母
https://stackoverflow.com/questions/69680405
复制相似问题