crontab v1.1.10 Crontab.CronExpression View Source
This is the Crontab.CronExpression module / struct.
Link to this section Summary
Types
day()
deprecated
hour()
deprecated
min_max()
deprecated
minute()
deprecated
month()
deprecated
second()
deprecated
time_unit()
deprecated
weekday()
deprecated
year()
deprecated
Functions
Defines the Cron Interval
Create a %Crontab.CronExpression{}
via sigil.
Convert Crontab.CronExpression struct to Tuple List
Link to this section Types
Link to this type
condition()
View Sourcecondition() :: condition(:second, Calendar.second()) | condition(:minute, Calendar.minute()) | condition(:hour, Calendar.hour()) | condition(:day, Calendar.day()) | condition(:month, Calendar.month()) | condition(:weekday, Calendar.day_of_week()) | condition(:year, Calendar.year())
Link to this type
condition(name, time_unit)
View Sourcecondition(name, time_unit) :: {name, [value(time_unit)]}
This type is deprecated. Use Calendar.day/0 instead.
This type is deprecated. Use Calendar.hour/0 instead.
Link to this type
interval()
View Sourceinterval() :: :second | :minute | :hour | :day | :month | :weekday | :year
This type is deprecated. Use Crontab.CronExpression.min_max/1 instead.
This type is deprecated. Use Calendar.minute/0 instead.
This type is deprecated. Use Calendar.month/0 instead.
This type is deprecated. Use Calendar.second/0 instead.
This type is deprecated. Use Calendar.[second|minute|hour|day|month|day_of_week|year]/0 instead.
Link to this type
value()
View Sourcevalue() :: value(Calendar.second()) | value(Calendar.minute()) | value(Calendar.hour()) | value(Calendar.day()) | value(Calendar.month()) | value(Calendar.day_of_week()) | value(Calendar.year())
Link to this type
value(time_unit)
View Sourcevalue(time_unit) :: time_unit | :* | :L | {:L, value(time_unit)} | {:/, time_unit | :* | min_max(time_unit), pos_integer()} | min_max(time_unit) | {:W, time_unit | :L}
This type is deprecated. Use Calendar.day_of_week/0 instead.
This type is deprecated. Use Calendar.year/0 instead.
Link to this section Functions
Defines the Cron Interval
* * * * * * *
| | | | | | |
| | | | | | +-- :year Year (range: 1900-3000)
| | | | | +---- :weekday Day of the Week (range: 1-7, 1 standing for Monday)
| | | | +------ :month Month of the Year (range: 1-12)
| | | +-------- :day Day of the Month (range: 1-31)
| | +---------- :hour Hour (range: 0-23)
| +------------ :minute Minute (range: 0-59)
+-------------- :second Second (range: 0-59)
The :extended attribute defines if the second is taken into account.
Create a %Crontab.CronExpression{}
via sigil.
Examples
iex> ~e[*]
%Crontab.CronExpression{
extended: false,
second: [:*],
minute: [:*],
hour: [:*],
day: [:*],
month: [:*],
weekday: [:*],
year: [:*]}
iex> ~e[*]e
%Crontab.CronExpression{
extended: true,
second: [:*],
minute: [:*],
hour: [:*],
day: [:*],
month: [:*],
weekday: [:*],
year: [:*]}
iex> ~e[1 2 3 4 5 6 7]e
%Crontab.CronExpression{
extended: true,
second: [1],
minute: [2],
hour: [3],
day: [4],
month: [5],
weekday: [6],
year: [7]}
Link to this function
to_condition_list(interval)
View Sourceto_condition_list(t()) :: condition_list()
Convert Crontab.CronExpression struct to Tuple List
Examples
iex> Crontab.CronExpression.to_condition_list %Crontab.CronExpression{
...> minute: [1], hour: [2], day: [3], month: [4], weekday: [5], year: [6]}
[ {:minute, [1]},
{:hour, [2]},
{:day, [3]},
{:month, [4]},
{:weekday, [5]},
{:year, [6]}]
iex> Crontab.CronExpression.to_condition_list %Crontab.CronExpression{
...> extended: true, second: [0], minute: [1], hour: [2], day: [3], month: [4], weekday: [5], year: [6]}
[ {:second, [0]},
{:minute, [1]},
{:hour, [2]},
{:day, [3]},
{:month, [4]},
{:weekday, [5]},
{:year, [6]}]