cron-0.5.0: Cron datatypes and Attoparsec parser

Safe HaskellNone
LanguageHaskell2010

System.Cron.Types

Contents

Synopsis

Documentation

data CronSchedule #

Specification for a cron expression

Constructors

CronSchedule 

Fields

newtype Crontab #

Crontab file, omitting comments.

Constructors

Crontab 

Instances

Eq Crontab # 

Methods

(==) :: Crontab -> Crontab -> Bool #

(/=) :: Crontab -> Crontab -> Bool #

Show Crontab # 
Generic Crontab # 

Associated Types

type Rep Crontab :: * -> * #

Methods

from :: Crontab -> Rep Crontab x #

to :: Rep Crontab x -> Crontab #

type Rep Crontab # 
type Rep Crontab = D1 (MetaData "Crontab" "System.Cron.Types" "cron-0.5.0-2V5ctLJw7fe2eHoTj03k3V" True) (C1 (MetaCons "Crontab" PrefixI True) (S1 (MetaSel (Just Symbol "crontabEntries") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [CrontabEntry])))

data CrontabEntry #

Essentially a line in a crontab file. It is either a schedule with a command after it or setting an environment variable (e.g. FOO=BAR)

data MinuteSpec #

Minutes field of a cron expression

Instances

Eq MinuteSpec # 
Show MinuteSpec # 
Generic MinuteSpec # 

Associated Types

type Rep MinuteSpec :: * -> * #

type Rep MinuteSpec # 
type Rep MinuteSpec = D1 (MetaData "MinuteSpec" "System.Cron.Types" "cron-0.5.0-2V5ctLJw7fe2eHoTj03k3V" True) (C1 (MetaCons "Minutes" PrefixI True) (S1 (MetaSel (Just Symbol "minuteSpec") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 CronField)))

data HourSpec #

Hours field of a cron expression

Instances

Eq HourSpec # 
Show HourSpec # 
Generic HourSpec # 

Associated Types

type Rep HourSpec :: * -> * #

Methods

from :: HourSpec -> Rep HourSpec x #

to :: Rep HourSpec x -> HourSpec #

type Rep HourSpec # 
type Rep HourSpec = D1 (MetaData "HourSpec" "System.Cron.Types" "cron-0.5.0-2V5ctLJw7fe2eHoTj03k3V" True) (C1 (MetaCons "Hours" PrefixI True) (S1 (MetaSel (Just Symbol "hourSpec") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 CronField)))

data MonthSpec #

Month field of a cron expression

Instances

Eq MonthSpec # 
Show MonthSpec # 
Generic MonthSpec # 

Associated Types

type Rep MonthSpec :: * -> * #

type Rep MonthSpec # 
type Rep MonthSpec = D1 (MetaData "MonthSpec" "System.Cron.Types" "cron-0.5.0-2V5ctLJw7fe2eHoTj03k3V" True) (C1 (MetaCons "Months" PrefixI True) (S1 (MetaSel (Just Symbol "monthSpec") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 CronField)))

data DayOfMonthSpec #

Day of month field of a cron expression

Instances

data DayOfWeekSpec #

Day of week field of a cron expression

Instances

Eq DayOfWeekSpec # 
Show DayOfWeekSpec # 
Generic DayOfWeekSpec # 

Associated Types

type Rep DayOfWeekSpec :: * -> * #

type Rep DayOfWeekSpec # 
type Rep DayOfWeekSpec = D1 (MetaData "DayOfWeekSpec" "System.Cron.Types" "cron-0.5.0-2V5ctLJw7fe2eHoTj03k3V" True) (C1 (MetaCons "DaysOfWeek" PrefixI True) (S1 (MetaSel (Just Symbol "dayOfWeekSpec") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 CronField)))

data BaseField #

Individual field of a cron expression.

Constructors

Star

Matches anything

SpecificField' SpecificField

Matches a specific value (e.g. 1)

RangeField' RangeField

Matches a range of values (e.g. 1-3)

Instances

data SpecificField #

Instances

Eq SpecificField # 
Show SpecificField # 
Generic SpecificField # 

Associated Types

type Rep SpecificField :: * -> * #

type Rep SpecificField # 
type Rep SpecificField = D1 (MetaData "SpecificField" "System.Cron.Types" "cron-0.5.0-2V5ctLJw7fe2eHoTj03k3V" True) (C1 (MetaCons "SpecificField" PrefixI True) (S1 (MetaSel (Just Symbol "specificField") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Int)))

data RangeField #

Instances

Eq RangeField # 
Show RangeField # 
Generic RangeField # 

Associated Types

type Rep RangeField :: * -> * #

type Rep RangeField # 
type Rep RangeField = D1 (MetaData "RangeField" "System.Cron.Types" "cron-0.5.0-2V5ctLJw7fe2eHoTj03k3V" False) (C1 (MetaCons "RangeField" PrefixI True) ((:*:) (S1 (MetaSel (Just Symbol "rfBegin") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Int)) (S1 (MetaSel (Just Symbol "rfEnd") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Int))))

data CronField #

Constructors

Field BaseField 
ListField (NonEmpty BaseField)

Matches a list of expressions.

StepField' StepField

Matches a stepped expression, e.g. (*/2).

data StepField #

Instances

Eq StepField # 
Show StepField # 
Generic StepField # 

Associated Types

type Rep StepField :: * -> * #

type Rep StepField # 
type Rep StepField = D1 (MetaData "StepField" "System.Cron.Types" "cron-0.5.0-2V5ctLJw7fe2eHoTj03k3V" False) (C1 (MetaCons "StepField" PrefixI True) ((:*:) (S1 (MetaSel (Just Symbol "sfField") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 BaseField)) (S1 (MetaSel (Just Symbol "sfStepping") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Int))))

Commonly Used Schedules

yearly :: CronSchedule #

Shorthand for every January 1st at midnight. Parsed with @yearly, 0 0 1 1 *

monthly :: CronSchedule #

Shorthand for every 1st of the month at midnight. Parsed with @monthly, 0 0 1 * *

daily :: CronSchedule #

Shorthand for every day at midnight. Parsed with @daily, 0 0 * * *

weekly :: CronSchedule #

Shorthand for every sunday at midnight. Parsed with @weekly, 0 0 * * 0

hourly :: CronSchedule #

Shorthand for every hour on the hour. Parsed with @hourly, 0 * * * *

everyMinute :: CronSchedule #

Shorthand for an expression that always matches. Parsed with * * * * *

Rendering

Converting to human-readable string