Skip to content
/ cheek Public
forked from datarootsio/cheek

Crontab-like scHeduler for Effective Execution of tasKs, cheek for short.

License

Notifications You must be signed in to change notification settings

bquinart/cheek

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

93 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cheek

codecov example workflow Go Report Card Go Reference dataroots

cheek, of course, stands for Crontab-like scHeduler for Effective Execution of tasKs. 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.

Getting started

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.

Scheduler

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.

UI

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.

Docker

Check out the Dockerfile for an example on how to set up cheek within the context of a Docker image.

Acknowledgements

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.

GitHub Contributors

About

Crontab-like scHeduler for Effective Execution of tasKs, cheek for short.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 99.0%
  • Dockerfile 1.0%