apzuk3 / cron

Cron parser

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cron expression parser

License: MIT

Presumptions

  • Cron expression consists of only numbers. mon | january | @monthly are not supported
  • * is passed as an argument backslashed \*
  • The first argument after the cron expression is taken as the command
  • Rules are tested according to this source

Usage

Compile

Have go workspace setup on your machine

cd $GOPATH/src
git clone git@github.com:apzuk/cron.git cron
cd cron
go build -o cron cmd/main.go
./cron args...

Docker

Alternatively, if you have docker on your machine, run it on Docker.

docker run apzuk/cron args...

A few examples

docker run apzuk/cron -f --debug \* \* \* \* \*  

docker run apzuk/cron -f --debug */4 \* 8-14 \* \*

docker run apzuk/cron -f --debug */4 \* 8-14 3-7/2 \* /usr/bin/find

For more examples see cron_test.go

About

Cron parser

License:MIT License


Languages

Language:Go 98.6%Language:Dockerfile 1.4%