selfhost.directory

The index of self-hostable projects — ranked, categorized and served with live updates.
Own your data and stop giving it to big tech.

GitHub
docker-crontab logo

Self-host docker-crontab

1.0.0

Docker-native cron scheduler for containerized jobs

ReleaseOpen SourceMIT
Updated5 years ago
LanguageShell
Setup difficultyModerate
Stars
318
Requires
Docker Engine
Docker
willfarrell/crontab
Install with Docker

What is docker-crontab?

docker-crontab is a lightweight Docker container that acts as a cron scheduler for other containers. It reads job definitions from a config file (JSON, YAML, or TOML) and executes commands either directly in the crontab container, in a new container from an image, or via docker exec in an existing container. Jobs can trigger follow-up commands in other containers on completion. The project is configured by mounting a config directory and the Docker socket. It supports standard cron syntax plus @every intervals, comments, and on-start execution. The image is published as willfarrell/crontab on Docker Hub.

Should you self-host docker-crontab?

docker-crontab scores 46/100 on selfhost.directory (how scoring works) and ranks #20 of 34 in Task Management. It has 318 GitHub stars.

There was no stable release in the past 12 months, so check the repository's recent activity before you rely on it.

Setup is moderate: expect some configuration beyond a single command. An official Docker image is available. It is MIT-licensed and written mostly in Shell.

Its closest alternative on selfhost.directory is Super Productivity (83/100, 23 213 stars). It scores higher overall, so compare the two before you pick. See docker-crontab vs Super Productivity side by side.

Features

  • Container-aware cron scheduling
  • Docker socket integration
  • Flexible schedule syntax
  • Job triggers
  • Multiple config formats
  • On-start execution
  • Structured Logging

docker-crontab README

How to install docker-crontab

Install docker-crontab with Docker

Environment variables
LOG_FILE, HOME_DIR

docker build -t crontab . docker run -d -v /var/run/docker.sock:/var/run/docker.sock:ro -v ./env:/opt/env:ro -v /path/to/config/dir:/opt/crontab:rw -v /path/to/logs:/var/log/crontab:rw crontab

Build from source then run with Docker socket and config volume mounts

How to configure docker-crontab

  • commandCommand to run in crontab container or docker container/image

    Command to run in crontab container or docker container/image

  • commentHuman-readable comment included with crontab entry

    Human-readable comment included with crontab entry

  • containerFull container name or container alias if project is set

    Full container name or container alias if project is set

  • dockerargs Command line docker run/exec arguments for full control

    Command line docker run/exec arguments for full control

  • HOME_DIR/opt/crontabBase directory for config and job scripts

    Base directory for config and job scripts

  • imageDocker image name to run the command in (e.g. library/alpine:3.5)

    Docker image name to run the command in (e.g. library/alpine:3.5)

  • LOG_FILE/var/log/crontab/jobs.logPath to log file for job output

    Path to log file for job output

  • nameHuman readable name used as job filename (converted to slug)

    Human readable name used as job filename (converted to slug)

  • onstartfalseRun the command on crontab container start

    Run the command on crontab container start

    values: true, false

  • projectDocker Compose/Swarm project name for scaled containers

    Docker Compose/Swarm project name for scaled containers

  • scheduleCrontab schedule syntax (e.g. @hourly, @every 1h30m, * * * * *)

    Crontab schedule syntax (e.g. @hourly, @every 1h30m, * * * * *)

    values: Standard cron syntax plus @yearly, @monthly, @weekly, @daily, @hourly, @every

  • triggerArray of docker-crontab subset objects to run on job completion

    Array of docker-crontab subset objects to run on job completion

More in Docker Management

Rate this project

Click to rate — no account needed.

0 comments

Posting as guest
Loading comments…