cheek
, of course, stands for C
rontab-like scH
eduler for E
ffective E
xecution of tasK
s. cheek
is a KISS approach to crontab-like job scheduling. It was born out of a (/my?) frustration about the big gap between a lightweight crontab and full-fledged solutions like Airflow.
cheek
aims to be a KISS approach to job scheduling. Focus is on the KISS approach not to necessarily do this in the most robust way possible.
Fetch the latest version for your system below.
darwin-arm64 | darwin-amd64 | linux-386 | linux-arm64 | linux-amd64
You can (for example) fetch it like below, make it executable and run it. Optionally put the cheek
on your PATH
.
curl https://storage.googleapis.com/better-unified/darwin/amd64/cheek -o cheek
chmod +x cheek
./cheek
Create a schedule specification using the below YAML structure:
jobs:
my_job:
command: date
cron: "* * * * *"
triggers:
- another_job
another_job:
command:
- /bin/bash
- -c
- "sleep 2; echo bar"
foo_job:
command:
- ls
- .
cron: "* * * * *"
coffee_alert:
command: this fails
cron: "* * * * *"
retries: 3
If your command
requires arguments, please make sure to pass them as an array like in foo_job
.
The core of cheek
consists of a scheduler that uses a schedule specified in a yaml
file to triggers jobs when they are due.
You can launch the scheduler via:
cheek run ./path/to/my-schedule.yaml
Check out cheek run --help
for configuration options.
cheek
ships with a terminal ui you can launch via:
cheek ui
The UI allows to get a quick overview on jobs that have run, that error'd and their logs. It basically does this by fetching the state of the scheduler and by reading the logs that (per job) get written to $HOME/.cheek/
. Note that you can ignore these logs, output of jobs will always go to stdout as well.
The UI requires the scheduler to be up and running.
Check out the Dockerfile
for an example on how to set up cheek
within the context of a Docker image.
Thanks goes to:
- gronx: for allowing me not to worry about CRON strings.
- Charm: for their bubble-icious TUI libraries.
- Sam & Frederik: for valuable code reviews / feedback.