Cron binding spec
Detailed documentation on the cron binding component
Setup Dapr component
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: <NAME>
namespace: <NAMESPACE>
spec:
type: bindings.cron
version: v1
metadata:
- name: schedule
value: "@every 15m" # valid cron schedule
Schedule Format
The Dapr cron binding supports following formats:
Character | Descriptor | Acceptable values |
---|---|---|
1 | Second | 0 to 59, or |
2 | Minute | 0 to 59, or |
3 | Hour | 0 to 23, or (UTC) |
4 | Day of the month | 1 to 31, or |
5 | Month | 1 to 12, or |
6 | Day of the week | 0 to 7 (where 0 and 7 represent Sunday), or |
For example:
30 * * * * *
- every 30 seconds0 15 * * * *
- every 15 minutes0 30 3-6,20-23 * * *
- every hour on the half hour in the range 3-6am, 8-11pmCRON_TZ=America/New_York 0 0 30 04 * * *
- every day at 4:30am New York time
You can learn more about cron and the supported formats here
For ease of use, the Dapr cron binding also supports few shortcuts:
@every 15s
wheres
is seconds,m
minutes, andh
hours@daily
or@hourly
which runs at that period from the time the binding is initialized
Related links
- Bindings building block
- How-To: Trigger application with input binding
- How-To: Use bindings to interface with external resources
- Bindings API reference
Last modified February 16, 2021: Merge pull request #1235 from dapr/update-v0.11 (b4e9fbb)