FastAPI-Cronsv2.4.0

Format

Expressions are parsed by croniter and use the standard five-field form.

*
Minute
0–59
*
Hour
0–23
*
Day of month
1–31
*
Month
1–12
*
Day of week
0–6

Special characters

CharacterNameMeaningExample
*AsteriskEvery value in the field* * * * * — every minute
,CommaA list of values0 9,17 * * * — 09:00 and 17:00
-HyphenAn inclusive range0 9-17 * * * — hourly from 09:00 to 17:00
/SlashStep values*/15 * * * * — every 15 minutes

Common schedules

ExpressionRuns
* * * * *Every minute
*/5 * * * *Every 5 minutes
0 * * * *Every hour, on the hour
0 */2 * * *Every 2 hours
0 0 * * *Every day at midnight
30 3 * * *Every day at 03:30
0 9 * * 1-5Weekdays at 09:00
0 0 * * 0Every Sunday at midnight
0 0 1 * *The 1st of every month
0 0 1 1 *Once a year, on 1 January

Time zones

Schedules follow the process time zone

Next run times are computed in the local time of the process, while last_run and next_run are reported to the API in UTC. Pin TZ in your container or process manager so every replica agrees on what 0 0 * * * means.

bash
export TZ=UTC

Invalid expressions

An unparseable expression raises when the decorator runs at import time — not silently at the first scheduled tick. A typo fails your app on startup rather than quietly skipping a job in production.

Esc
IntroductionGetting StartedInstallationGetting StartedQuick StartGetting StartedCron ExpressionsCore ConceptsDefining JobsCore ConceptsHooksCore ConceptsConfigurationCore ConceptsState BackendsBackendsDistributed LockingBackendsDashboardOperationsHTTP EndpointsOperationsCLIOperations