cron-0.7.1: Cron datatypes and Attoparsec parser
Copyright(c) Michael Xavier 2012
LicenseMIT
MaintainerMichael Xavier <michael@michaelxavier.net>
Portabilityportable
Safe HaskellSafe-Inferred
LanguageHaskell2010

System.Cron.Parser

Description

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

import System.Cron.Parser

main :: IO ()
main = do
  print $ parseCronSchedule "*/2 * 3 * 4,5,6"
Synopsis

Parsers

cronSchedule :: Parser CronSchedule Source #

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 CronSchedule Source #

Same as cronSchedule but does not fail on extraneous input.

crontab :: Parser Crontab Source #

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

crontabEntry :: Parser CrontabEntry Source #

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

Convenience Functions