Part of the CronCommander project — a control plane for cron jobs across your infrastructure.
CronCommander Agent is a lightweight Go binary that connects your servers to the CronCommander control plane. It gives you visibility and control over cron jobs without replacing cron itself.
- Daemon Mode: Long-lived agent connecting via WebSocket to
gateway.croncommander.com - Cron Synchronization: Receives job definitions from the server and writes them to
/etc/cron.d/croncommander - Execution Wrapper: Wraps each job to capture stdout/stderr, exit codes, and timing
- Dual Modes: User Mode (unprivileged, manages its own crontab) or System Mode (root, manages
/etc/cron.d) - Security Hardened: No-new-privileges, minimal environment, controlled working directory
- Version Injection: Version is embedded at compile time via
-ldflags
curl -sSL https://croncommander.com/install.sh | bashSet your API key and gateway URL via environment variables:
CC_API_KEY="your-api-key" \
curl -sSL https://croncommander.com/install.sh | bashThe installer auto-detects your OS and architecture and downloads the correct binary.
-
Download the binary from releases/ or build from source:
make build
-
Install the binary:
sudo cp bin/cc-agent-*-linux-amd64 /usr/local/bin/cc-agent sudo chmod 755 /usr/local/bin/cc-agent -
Create config:
sudo mkdir -p /etc/croncommander sudo tee /etc/croncommander/config.yaml > /dev/null <<EOF api_key: your-api-key server_url: wss://gateway.croncommander.com/ EOF
-
Run:
cc-agent daemon --config /etc/croncommander/config.yaml
The agent runs as a daemon, maintaining a WebSocket connection to the CronCommander gateway:
cc-agent daemon --config /etc/croncommander/config.yamlThe exec subcommand wraps job execution for reporting. It is called automatically by cron — not by users directly:
cc-agent exec --job-id abc123 -- /path/to/script.sh arg1 arg2This captures:
- Start time and duration
- Exit code
- stdout/stderr output (capped at 256KB each)
- Executing user and UID
cc-agent --versionCronCommander Agent is designed with security as a first-class concern:
| Feature | Description |
|---|---|
| User Mode (default) | Agent runs as cc-agent-user, manages its own crontab only |
| System Mode | Opt-in root mode for /etc/cron.d management |
| No-new-privileges | Uses PR_SET_NO_NEW_PRIVS to prevent setuid escalation (Linux 3.5+) |
| Minimal environment | Only PATH, HOME, LANG, and LC_ALL are set |
| Controlled working directory | Jobs execute in /var/lib/croncommander |
| Systemd hardening | ProtectSystem=strict, ProtectHome=yes, NoNewPrivileges=yes |
For more details, see Security Documentation.
The agent is configured via YAML file:
# Agent version
version: 1.1.0
# Workspace API key for authentication
api_key: your-workspace-api-key
# WebSocket gateway URL
server_url: wss://gateway.croncommander.com/
# Execution mode: "user" (default) or "system"
execution_mode: userDefault config location: /etc/croncommander/config.yaml
- Go 1.23+
- The root
VERSIONfile (read automatically by the Makefile)
make buildProduces versioned binaries in bin/, e.g. cc-agent-1-1-0-linux-amd64.
make publishCopies binaries to releases/ and ../build/ for local development.
go test ./...┌─────────────────────────────────────────────────────────┐
│ Host/Container │
│ │
│ ┌──────────────┐ ┌─────────────────────────────┐ │
│ │ cc-agent │◄───│ /etc/cron.d/croncommander │ │
│ │ (daemon) │ └─────────────────────────────┘ │
│ │ │ │
│ │ WebSocket │ ┌─────────────────────────────┐ │
│ │ connection │◄───│ cc-agent exec │ │
│ │ │ │ (reports via Unix socket) │ │
│ └──────┬───────┘ └─────────────────────────────┘ │
│ │ │
└─────────┼───────────────────────────────────────────────┘
│
▼
┌─────────────────────┐
│ CronCommander │
│ Gateway │
│ (gateway. │
│ croncommander.com) │
└─────────────────────┘
Apache-2.0 — see LICENSE
Part of the CronCommander project — a control plane for cron jobs across your infrastructure.
- Website: https://croncommander.com
- Documentation: https://croncommander.com/docs.html
- Pricing: https://croncommander.com/pricing.html
- GitHub: https://github.com/croncommander