Getting started

Install, run, verify, and add your first job. Aim: under five minutes from clone to first fire.

Prerequisites

  • Docker + Docker Compose (any recent version)
  • OR Rust 1.88+ if building from source

Run it

With Docker (fastest):

docker run -d --name cronmanager -p 8080:8080 \
  turnerrainer/cronmanager:alpha

With Docker Compose (includes TimescaleDB for execution history):

git clone -b dev https://github.com/turnerrainer/cronmanager.git
cd cronmanager
docker compose up -d

From source:

git clone -b dev https://github.com/turnerrainer/cronmanager.git
cd cronmanager
cargo run --release

Verify it

curl http://localhost:8080/health
{"status":"ok"}

List loaded jobs:

curl -s http://localhost:8080/jobs

The response is { "<group>": [ { "name": …, "schedule": …, "nextExecution": … }, … ] }. Groups are derived from the directory layout under dsl_path — DSL/samples/http/health-check.yaml becomes group samples-http-health-check.

Add your first HTTP job

Create DSL/mine/ping.yaml:

ping_google:
  trigger: "0 */5 * * * ?"
  type: http
  method: GET
  url: https://www.google.com/
  retryCount: 2
  retryDelay: 1000
  ignoreFailures: true

Restart the container (or send POST /reload/samples-mine-ping if already running):

docker compose restart cronmanager
curl -s http://localhost:8080/jobs | grep ping_google

Add your first shell job

Put your script under scripts/mine/hello.sh:

#!/usr/bin/env bash
echo "hello from $(hostname), backup dir is ${BACKUP_DIR:-unset}"

Register it in DSL/mine/hello.yaml:

say_hello:
  trigger: "0 * * * * ?"
  type: exec
  command: ./scripts/mine/hello.sh
  allowedEnvs:
    - BACKUP_DIR

allowedEnvs is an opt-in whitelist. Only listed variables from shell_environment in cronmanager.yaml are exported to the process. See Configuration for the full env model.

Trigger a job manually

Every job — even one with trigger: off — can be fired ad hoc:

curl -X POST http://localhost:8080/execute/samples-mine-hello/say_hello

Read the execution history

When a Postgres URL is configured (see Configuration), every attempt is recorded. Query it directly:

docker exec -it cronmanager-timescaledb \
  psql -U cronmanager -d cronmanager \
  -c 'SELECT job_name, status, execution_time FROM job_execution_history ORDER BY execution_time DESC LIMIT 10;'

Where to next