cronenberg

module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2019 License: Apache-2.0

README

cronenberg

Build Status Go Report Card Documentation

It's like cron, but kinda twisted.

Installation

You can either download the appropriate release from the releases page or install via go get:

go get -u github.com/ess/cronenberg/cmd/cronenberg

Basics

Cronenberg works similarly to the standard cron that you already know and love, but with a few differences:

  • It is not meant to be run as a system service
  • It does not use a traditional crontab
  • Jobs for a given cronenberg instance are loaded from a YAML file
  • It supports locking jobs (jobs that can only ever have one running instance)
  • It logs to STDOUT
  • It supports both incoming (from the system) and job-scoped environment variables

In short, this is the cron implementation that you run along side your 12-factor application.

Jobs File

There is not a hard-coded location for your jobs file. Instead, you pass the jobs file as the first argument to the cronenberg command like so:

cronenberg /path/to/my/jobs/file.yml

This is just a YAML file containing an array of Job objects. Here's an example jobs file:

# Job objects require a name, a command, and a schedule (when). You can also
# specify a description, whether or not the job locks, and a hash of environment
# variables for the job.

# This is just a normal job that runs every minute
- name: what-am-i
  command: echo "I am a command"
  when: "* * * * *"

# This is a locking job that is scheduled to run every minute so long as there
# is not already an instance of the job in progress.
- name: picky-picky
  command: 'echo "I am a picky command" ; sleep 70'
  when: "* * * * *"
  lock: true

# This is a job that runs every five minutes and specifies an environment
# variable. If this variable is also set in cronenberg's executing shell, the
# value configured here takes precedence.
- name: know-your-environment
  command: echo $flibberty
  when: "*/5 * * * *"
  env:
    flibberty: gibbets

History

  • v1.0.0 - Initial Release

Directories

Path Synopsis
cmd
pkg
cronenberg
Package cronenberg provides interfaces and types for running external processes repeatedly at specific times.
Package cronenberg provides interfaces and types for running external processes repeatedly at specific times.
cronenberg/cron
Package cron provides mechanisms for using the upstream cron package.
Package cron provides mechanisms for using the upstream cron package.
cronenberg/fs
Package fs provides functions for working with the file system as well as services that specifically deal with the file system.
Package fs provides functions for working with the file system as well as services that specifically deal with the file system.

Jump to

Keyboard shortcuts

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