GithubHelp home page GithubHelp logo

cfc's Introduction

Cron for Containers

Crates.io Coverage status Apache License Documentation

Cron for Containers is a lightweight cron daemon for containers that aims to be an in-place replacement for ofelia wherever mail capabilities are not required.

Currently, only docker and podman are supported.

Installation

Install the executable with cargo:

cargo install cfc

Usage

You may either provide a configuration file or extract configuration from container labels.

The scheduling format is an "augmented" cron format inspired by go's implementation. E.g. @every 10m`` or 0 10 * * * *`.

Note: The cron format does not have to contain the seconds specifier

You can configure four different kind of jobs:

job-exec: Executed in a running container. job-run: Executed in a new container, using a specific image. job-local: Executed on the host running ofelia. job-service-run: Executed in a new "run-once" service, for running inside a swarm

INI-style config

[job-exec "job-executed-on-running-container"]
schedule = @hourly
container = my-container
command = touch /tmp/cfc

YAML-style config

job-executed-on-running-container:
    kind: job-exec
    schedule: "@hourly"
    container: my-container
    command: touch /tmp/cfc

Label-based config

docker run -it --rm \
  --label cfc.job-run.my-test-job.schedule="@every 5s" \
  --label cfc.job-run.my-test-job.command="echo Hello world" \
  alpine:latest sleep 9999

Ofelia compatibility

Add --ofelia to the command-line when running cfc to run in compatibility mode.

Note

Though both an executable and a library are made available, the library is only intended for consumption by the executable and its API should not be considered stable.

cfc's People

Contributors

ayowel avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.