Cloud customer?
Start for Free>
Upgrade in MyJFrog >
What's New in Cloud >





Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment:Updated code example for incorrect interval on running cron

Overview

Excerpt

ACronTriggeris used as aninputResourceto a step to trigger execution of the step at a scheduled time or at a recurring interval.

The minimum recurring interval forCronTriggeris one minute and it supports thecron syntaxand UTC time.

Panel
title Page Contents

Table of Contents
maxLevel 2
minLevel 2


YAML Schema

Code Block
language yml
resources: - name:  type: CronTrigger configuration: interval:  # should be a cron expression

Tags

name

Analphanumericstring (underscores are permitted) that identifies the resource.

type

Must beCronTriggerfor this resource type.

configuration

Specifies all configuration selections for the resource.

Tag

Description

Required/Optional
interval

A

Newtablink
Text cron expression
URL https://en.wikipedia.org/wiki/Cron#CRON_expression
string that specifies the time(s) or interval to trigger the step.

Theintervaltag uses standardCron expressionand takes thefollowing format:

Code Block
title Format
时间间隔 : * * * * * │││││ _________ 的一天week (1-7 or SUN-SAT) | | | |__________ month (1 - 12) | | |__________ day of the month (1 - 31) | |__________ hour (0 - 23) |__________ minute (0 - 59)

Examples

CRON Expression Meaning

0 12 * * *

12 PM (noon) every day.

25 10 * * *

10:25 AM every day.

15 22 * * *

10:15 PM every day.

* 16 * * *

Every minute starting at 4 PM and ending at 4:59 PM, every day.

0/5 13 * * *

Every 5 minutes starting at 1 PM and ending at 1:55 PM, every day.

0/5 15,18 * * *

Every 5 minutes starting at 3 PM and ending at 3:55 PM, and every 5 minutes starting at 6 PM and ending at 6:55 PM, every day.

0-5 18 * * *

Every minute starting at 6 PM and ending at 6:05 PM, every day.

10,44 15 * 5 MON

3:10 PM and at 3:44 PM every Monday in the month of May.

45 10 * * MON-FRI

10:45 AM every Monday, Tuesday, Wednesday, Thursday and Friday.

30 10 10 * *

10:30 AM on the 10th day of every month.

0 12 1/5 * *

12 PM (noon) on every 5th day-of-month from 1 through 31.

11 11 11 11 *

Every November 11th at 11:11 AM.

Info
  • For more information, seeCron expression.
  • It is recommended that you first test your Cron expression using anonline toolbefore using it.
Required

Environment Variables

WheneverCronTriggeris used in a step, a set of environment variables is automatically made available that you can use in your step.

Environment Variable

Description

res__name
Name of the resource
res__interval
The cron string that specifies the time(s) or interval

Examples

The Pipelines DSL for this example is available inthis repositoryin theJFrogGitHub account.

Code Block
language yml
resources: - name: cron_trigger type: CronTrigger configuration: interval: '*0 */5 *?* **' # Every 5 minutes pipelines: - name: pipeline_scheduled_triggers steps: - name: step_1 type: Bash configuration: inputResources: - name: cron_trigger execution: onExecute: - printenv


Copyright © 2023 JFrog Ltd.