GithubHelp home page GithubHelp logo

croner's Introduction

Overview

This is a simple scala cron parser used for parsing some cron parameters and output result in a specific format.

One of tons of doc about cron

Requirements

  • You'll need scala 2.13
  • You'll need scalatest and scalactic for running the tests.

How to use/run

  • This is sbt based project, you can import and build it in IntelliJ.

  • runner is simple bash for running your build output from SBT.

  • runner takes 6 parameters in this order: Minute, Hour, DayOfMonth, Month, DayOfWeek, Command.

    $ ./runner 2 3 */5 1-5 \* /lib/exec
    
    minute        2
    hour          3
    day of month  1 6 11 16 21 26
    month         1 2 3 4 5
    day of week   1 2 3 4 5 6 7
    command       /lib/exec
    

    Note: Make sure to skip the * in the terminal as shown above.

  • If there is any parsing error, it will throw an IllegalArgumentException.

java.lang.IllegalArgumentException: requirement failed: Found: List(2, 3, */5, 1-5, *, /lib/exec, ds)
Please provide all 6 parameters: minute, hour, day of month, month, day of week, command

Supported use cases

  • */-, and numbers are allowed in the parameters.
  • Fixed months to be 30 days long.

Not Supported (yet)

  • Comma separated patterns. e.g 1-5,6/10
  • * in values e.g 1*-20
  • Written Days patterns in the Day of the week e.g SUN,MON.
  • Written Months patterns e.g JAN,FEB.
  • Years parameters.
  • Extra special characters like LWC#?.

croner's People

Contributors

omarel-mohandes avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.