Skip to content

apzuk3/cron

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Releases

No releases published

Packages

No packages published