butt

command module
v0.0.0-...-c89a435 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 13, 2021 License: MIT Imports: 1 Imported by: 0

README

butt

codecov example workflow Go Report Card Go Reference dataroots

butt, of course, stands for Better Unified Time-Driven Triggering. butt is a KISS approach to crontab-like job scheduling. butt was born out of a (/my?) frustration about the big gap between a lightweight crontab and full-fledged solutions like Airflow.

butt 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 butt on your PATH.

curl https://storage.googleapis.com/better-unified/darwin/amd64/butt -o butt
chmod +x butt
./butt

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 butt 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:

butt run ./path/to/my-schedule.yaml

Check out butt run --help for configuration options.

UI

butt ships with a terminal ui you can launch via:

butt 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/.butt/. 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 butt 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.
  • Freddy: for cracking them butt jokes.
  • Murilo: for asking me about my butt.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL