Cron datatypes and Attoparsec parser http://github.com/michaelxavier/cron
|Latest on Hackage:||0.2.6|
This package is not currently in any snapshots. If you're interested in using it, we recommend adding it to Stackage Nightly. Doing so will make builds more reliable, and allow stackage.org to host generated Haddocks.
Cron data structure and Attoparsec parser for Haskell. The idea is to embed it in larger systems which want to roll their own scheduled tasks in a format that people are used to.
System.Cron is where all the interesting datatypes live. You will also find
scheduleMatches, which you can use to compare a time against a
to see if an action needs to be performed. System.Cron.Parser is where you will
find the parsers
cronTab. To parse
individual schedules up to full crontab files.
To do anything, you'll need to install cabal-dev with cabal.
To build, run:
To run tests, run:
If you have inotify-tools, run this to run tests continuously.
To generate docs:
Cron offers a scheduling monad which can be found in
System.Cron.Schedule. This monad transform allows you to declare a set of jobs (of the type
IO ()) that will be executed at intervals defined by cron strings.
main :: IO () main = do ... tids <- execSchedule $ do addJob job1 "* * * * *" addJob job2 "0 * * * *" print tids ... job1 :: IO () job1 = putStrLn "Job 1" job2 :: IO () job2 = putStrLn "Job 2"
* GHC 7.10 support
* Bugfixes for new task runner feature
* Add new in-process task runner feature. Credit to @AndrewRademacher
* Fix edge case when day of month and day of week are both specified. Credit to @joelwilliamson
* Fix day of week bug. Credit to @meteogrid
* Relax dependency on text to allow 1.0