cron-0.1.1: Cron datatypes and Attoparsec parser

MaintainerMichael Xavier <>
Safe HaskellNone



Attoparsec parser combinator for cron schedules. See cron documentation for how those are formatted.

 import Data.Attoparsec.Text (parseOnly)
 import System.Cron.Parser
 main :: IO ()
 main = do
   print $ parseOnly cronSchedule "*/2 * 3 * 4,5,6"



cronSchedule :: Parser CronScheduleSource

Attoparsec Parser for a cron schedule. Complies fully with the standard cron format. Also includes the following shorthand formats which cron also supports: @yearly, @monthly, @weekly, @daily, @hourly. Note that this parser will fail if there is extraneous input. This is to prevent things like extra fields. If you want a more lax parser, use cronScheduleLoose, which is fine with extra input.

cronScheduleLoose :: Parser CronScheduleSource

Same as cronSchedule but does not fail on extraneous input.

crontab :: Parser CrontabSource

Parses a full crontab file, omitting comments and including environment variable sets (e.g FOO=BAR).

crontabEntry :: Parser CrontabEntrySource

Parses an individual crontab line, which is either a scheduled command or an environmental variable set.