Tarearbol.Crontab.parse

You're seeing just the function parse, go back to Tarearbol.Crontab module for more information.

Specs

parse(input :: binary()) :: t()

Parses the cron string into human-readable representation.

This function is exported for debugging purposes only, normally one would call prepare/1 instead.

Input format: "minute hour day/month month day/week".

Examples:

iex> Tarearbol.Crontab.parse "10-30/5 */4 1 */1 6,7"
%Tarearbol.Crontab{
  day: "(day == 1)",
  day_of_week: "(day_of_week == 6 || day_of_week == 7)",
  hour: "(rem(hour, 4) == 0)",
  minute: "(rem(minute, 5) == 0 && minute >= 10 && minute <= 30)",
  month: "(rem(month, 1) == 0)"
}

In case of malformed input:

iex> Tarearbol.Crontab.parse "10-30/5 */4 1 */1 6d,7"
%Tarearbol.Crontab{
  day: "(day == 1)",
  day_of_week: {:error, {:could_not_parse_integer, "6d"}},
  hour: "(rem(hour, 4) == 0)",
  minute: "(rem(minute, 5) == 0 && minute >= 10 && minute <= 30)",
  month: "(rem(month, 1) == 0)"
}