2019-09-10 13:32:51 -04:00
|
|
|
[role="xpack"]
|
2017-03-28 17:23:01 -04:00
|
|
|
[[schedule-daily]]
|
2019-09-30 13:18:50 -04:00
|
|
|
==== Daily schedule
|
2017-03-28 17:23:01 -04:00
|
|
|
|
2019-09-30 13:18:50 -04:00
|
|
|
A <<trigger-schedule,`schedule`>> that triggers at a particular time
|
2017-03-28 17:23:01 -04:00
|
|
|
every day. To use the `daily` schedule, you specify the time of day (or times)
|
|
|
|
when you want the scheduler to start the watch execution with the `at` attribute.
|
|
|
|
|
|
|
|
Times are specified in the form `HH:mm` on a 24-hour clock. You can also use the
|
|
|
|
reserved values `midnight` and `noon` for `00:00` and `12:00`, and
|
2019-09-30 13:18:50 -04:00
|
|
|
<<specifying-times-using-objects,specify times using objects>>.
|
2017-03-28 17:23:01 -04:00
|
|
|
|
|
|
|
NOTE: If you don't specify the `at` attribute for a `daily` schedule, it defaults
|
|
|
|
to firing once daily at midnight, `00:00`.
|
|
|
|
|
2019-09-30 13:18:50 -04:00
|
|
|
===== Configuring a daily schedule
|
2017-03-28 17:23:01 -04:00
|
|
|
|
|
|
|
To configure a once a day schedule, you specify a single time with the `at`
|
|
|
|
attribute. For example, the following `daily` schedule triggers once every
|
|
|
|
day at 5:00 PM:
|
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
|
|
|
{
|
|
|
|
"trigger" : {
|
|
|
|
"schedule" : {
|
|
|
|
"daily" : { "at" : "17:00" }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|
2018-06-22 21:09:37 -04:00
|
|
|
// NOTCONSOLE
|
2017-03-28 17:23:01 -04:00
|
|
|
|
2019-09-30 13:18:50 -04:00
|
|
|
===== Configuring a multiple times daily schedule
|
2017-03-28 17:23:01 -04:00
|
|
|
|
|
|
|
To configure a `daily` schedule that triggers at multiple times during the day,
|
|
|
|
you specify an array of times. For example, the following `daily` schedule
|
|
|
|
triggers at `00:00`, `12:00`, and `17:00` every day.
|
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
|
|
|
{
|
|
|
|
"trigger" : {
|
|
|
|
"schedule" : {
|
|
|
|
"daily" : { "at" : [ "midnight", "noon", "17:00" ] }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|
2018-06-22 21:09:37 -04:00
|
|
|
// NOTCONSOLE
|
2017-03-28 17:23:01 -04:00
|
|
|
|
|
|
|
[[specifying-times-using-objects]]
|
2019-09-30 13:18:50 -04:00
|
|
|
===== Specifying times using objects
|
2017-03-28 17:23:01 -04:00
|
|
|
|
|
|
|
In addition to using the `HH:mm` string syntax to specify times, you can specify
|
|
|
|
a time as an object that has `hour` and `minute` attributes.
|
|
|
|
|
|
|
|
For example, the following `daily` schedule triggers once every day at 5:00 PM:
|
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
|
|
|
{
|
|
|
|
"trigger" : {
|
|
|
|
"schedule" : {
|
|
|
|
"daily" : {
|
|
|
|
"at" {
|
|
|
|
"hour" : 17,
|
|
|
|
"minute" : 0
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|
2018-06-22 21:09:37 -04:00
|
|
|
// NOTCONSOLE
|
2017-03-28 17:23:01 -04:00
|
|
|
|
|
|
|
To specify multiple times using the object notation, you specify multiple hours
|
|
|
|
or minutes as an array. For example, following `daily` schedule triggers at
|
|
|
|
`00:00`, `00:30`, `12:00`, `12:30`, `17:00` and `17:30` every day:
|
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
|
|
|
{
|
|
|
|
"trigger" : {
|
|
|
|
"schedule" : {
|
|
|
|
"daily" : {
|
|
|
|
"at" {
|
|
|
|
"hour" : [ 0, 12, 17 ],
|
|
|
|
"minute" : [0, 30]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|
2018-06-22 21:09:37 -04:00
|
|
|
// NOTCONSOLE
|