GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - nicomt/ckron: 🐋 A cron-like job scheduler for docker

BranchesTags
Open more actions menu

Latest commit

 

History

221 Commits
221 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
bin
bin
 
 
docs
docs
 
 
lib
lib
 
 
test
test
 
 
.dockerignore
.dockerignore
 
 
.editorconfig
.editorconfig
 
 
.eslintrc.yml
.eslintrc.yml
 
 
.gitignore
.gitignore
 
 
Dockerfile
Dockerfile
 
 
license.md
license.md
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
readme.md
readme.md
 
 

Repository files navigation

ckron

A cron-style job scheduler for docker

NPM Version Test Docker Image Size

ckron is a versatile and straightforward tool to schedule operations on containerized applications.

ckron is heavily inspired by ofelia but attempts to improve on it by allowing multiple tasks per job. Using tasks, you can compose complex workflows with a few off-the-shelf images and follow Docker's motto of one process per container.

Install

If you have Node installed:

$ npm i -g ckron

If you only have Docker installed:

$ docker pull nicomt/ckron

Usage

If you installed it in Node:

$ ckron daemon --config /path/to/config.yml

If you installed it in Docker:

$ docker run --rm -it \
      -v $PWD/config.yml:/etc/ckron/config.yml \
      -v /var/run/docker.sock:/var/run/docker.sock \
      nicomt/ckron daemon

NOTE: For production is recommended to use docker with a restart policy or create a service in something like systemd, upstart or forever. A service will ensure the daemon is restarted in case of an unexpected failure

Configuration

The configuration consists of a YAML file, which is meant to have familiar docker compose like syntax. The main sections of the config file are the following:

Tasks

Single operations that can be carried out by a job. Tasks currently supported are:

  • run: Runs a command inside of a new container, using a specific image.
  • exec: Runs a new command in a running container
  • signal: Send a signal to the main process inside the container. Similar to docker kill --signal

See tasks reference for more documentation

Jobs

Jobs are sets of tasks scheduled with a cron-like syntax. See jobs reference for more documentation

Notifiers

Notification channels for failed jobs. See notifiers reference for more documentation

YAML Full Example

Run with $ ckron daemon --config /path/to/config.yml

tasks:
  test-01:
    type: run
    command: printenv
    environment:
      HELLO: World
    image: ubuntu:latest
jobs:
  job-01:
    schedule: "*/30 * * * * *"
    on_error: ["email-dev"]
    run_on_init: true
    tasks:
      - test-01
notifiers:
  email-dev:
    type: email
    smtp_host: smtp.server.com
    smtp_port: 25
    smtp_auth:
      user: XXXXXXX
      pass: XXXXXXX
    to: [email protected]
    from: '"Ckron Scheduler" <[email protected]>'

About

🐋 A cron-like job scheduler for docker

Topics

croncronjobdockerjavascriptlinuxnodejsscheduler

Resources

Readme
ISC license
Activity

Stars

58 stars

Watchers

1 watching

Forks

6 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.