Skip to content

bcicen/tinycron

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tinycron

A very small replacement for cron. Particularly useful within containers and for distributing cron tasks alongside a project as a standalone file.

Installing

curl -sLo tinycron https://github.com/bcicen/tinycron/releases/download/v0.3/tinycron-0.3-linux-amd64
sudo mv tinycron /usr/local/bin/
sudo chmod +x /usr/local/bin/tinycron

Usage

tinycron [expression] [command]

Tinycron can be conveniently used in your scripts interpreter line:

#!/usr/local/bin/tinycron */5 * * * * * * /bin/sh
echo "Current time: $(date)"

Or invoked directly via commandline:

$ tinycron '*/5 * * * * * *' /bin/echo hello

Expressions

Tinycron uses and supports expressions from the cronexpr library. Some examples:

  • @daily - run once daily, at midnight
  • * 15 * * * * * - run at minute :15 of every hour
  • */30 * * * * * * - run every 30 seconds

Config

TinyCron can be configured by setting the below environmental variables to a non-empty value:

Variable Description
TINYCRON_VERBOSE Enable verbose output