CRONEXPR(1)

NAME
cronexpr - evaluate cron expressions and print next scheduled times

SYNOPSIS
cronexpr [OPTIONS] "CRON EXPRESSION"

DESCRIPTION
cronexpr parses a cron expression and prints the next time(s) it would fire, relative to a given reference time (default: now).

CRON EXPRESSION must be quoted to prevent shell word-splitting. Both 5-field (minute hour day month weekday) and 6-field (with seconds) expressions are supported, as well as the @yearly / @monthly / @weekly / @daily / @hourly shorthand forms.

OPTIONS

-t TIME
    Reference time against which the expression is evaluated. TIME is a whole or partial RFC 3339 value (e.g. 2006-01-02T15:04:05Z07:00). Defaults to the current local time if omitted.

-n COUNT
    Number of next scheduled times to output. Default: 1.

-l LAYOUT
    Go time layout string used to format each output time. See time package constants in the Go standard library for the reference time format. Default: Mon, 02 Jan 2006 15:04:05 MST.

OUTPUT
One time value per line, in chronological ascending order. Lines beginning with # are comments and can be ignored by callers interested only in the time values.

EXAMPLES
Print the next time */15 * * * * will fire:

        cronexpr "*/15 * * * *"

Print the next 5 occurrences of a daily job starting from a fixed time:

        cronexpr -n 5 -t 2024-01-01 "0 9 * * 1-5"

SEE ALSO
supercronic(1), crontab(5)

BUGS
Please report bugs at <https://github.com/aptible/supercronic/issues>.