v1.2.1

Schedule Syntax

Last updated


This page lists the spec formats Add accepts: five-field cron expressions, descriptors, and @every intervals.

Cron Expressions


Exactly five fields, evaluated in the configured Location:
FieldRange
Minute0-59
Hour0-23
Day of month1-31
Month1-12
Day of week0-6 (0 is Sunday)

SyntaxExampleMatching rule
**Any value
n30Equals n
n-m9-17Between n and m inclusive
a,b,n-m0,30List, ranges allowed, duplicates removed
*/n*/15Field value divisible by n

*/n tests the field value itself, not an offset from the field minimum: */5 in the day-of-month field matches days 5, 10, 15, 20, 25, and 30, and */2 in the month field matches even months. n-m/s and month or weekday names are not supported. The next fire time starts at the following minute and advances minute by minute until all five fields match.

Descriptors and Intervals


SpecEquivalent
@yearly, @annually0 0 1 1 *
@monthly0 0 1 * *
@weekly0 0 * * 0
@daily, @midnight0 0 * * *
@hourly0 * * * *
@every <duration>Parsed by time.ParseDuration; minimum 30 seconds; next fire = time the trigger was handled + duration

See Configuration for setting the timezone and Task API for parse errors.
中文