如何在Yaml文件的cron中使用0/10?

问题描述 投票:0回答:1

在尝试使用yaml文件部分中引用的cron作业作为我的circleci CI系统的一部分:

我希望作业以0/10 * * * *格式每10分钟运行一次,但我得到`配置不符合架构

那么如何在Yaml文件中的cron中使用0/10

使用有效的cron表达:

https://crontab.guru/#0/10_ _ _ _

我知道

Config does not conform to schema: 
{:workflows {:hourly {:triggers [{:schedule {:cron (not (:circleci.specs.cron/posix-expr \"0/10 * * * *\"))}}]}}}

我尝试了多种格式,例如

cron: "0/10 * * * *"
cron: 0/10 * * * *
cron: "0\/10 * * * *"
cron: 0\/10 * * * *

但没有有效的斜杠。

本节的其余部分:

  hourly:
    triggers:
      - schedule:
          cron: "0/10 * * * *"
          filters:
            branches:
              only:
                - master
                - circleci-project-setup:
cron yaml circleci
1个回答
0
投票

The docs

cron键是使用POSIX crontab语法定义的。

linked manpage未指定/。它是非标准的,显然不受支持。 Wikipedia says that

POSIX没有定义斜杠的用法;其基本原理(评论BSD扩展名)指出,该定义基于System V格式,但不排除扩展的可能性

所以您在这里不能使用/

© www.soinside.com 2019 - 2024. All rights reserved.