CLI reference

sundial <command> [flags]

Commands

CommandWhat it does
serveStay up and run jobs on schedule. The only long-running command.
checkParse the config, print the next five runs per job. Non-zero exit on any problem.
run <job>Run one job now, in the foreground, with its output on the terminal.
log <job>Print recorded runs for a job: start, duration, exit code.
listOne line per job: name, schedule, last exit code, last run.
versionVersion, commit and build date.

Global flags

FlagDefaultMeaning
-c, --config~/.config/sundial/jobs.confConfig file path.
--state~/.local/state/sundialWhere the run log lives.
--jsonfalseMachine-readable output for list and log.
--dry-runfalseWith run: print the command instead of executing it.

Job fields

FieldRequiredMeaning
runyesCommand line. Executed without a shell unless it contains a pipe or redirect.
scheduleyesSee schedule syntax.
timeoutnoKill the run after this long. Default: none.
tznoIANA zone for at schedules.
workdirnoWorking directory. Default: the directory of the config file.
envnoExtra environment, as { KEY = "value" }.
on_failno"ignore" (default), "notify", or a command to run.

Running under systemd

# /etc/systemd/system/sundial.service
[Unit]
Description=sundial
After=network-online.target

[Service]
ExecStart=/usr/local/bin/sundial serve -c /etc/sundial/jobs.conf
Restart=on-failure
RestartSec=5s
User=sundial

[Install]
WantedBy=multi-user.target

Reload the config without dropping running jobs by sending SIGHUP; jobs already executing finish under their old definition.

Exit codes

CodeMeaning
0Success.
1Runtime error — a job failed, or the state directory is not writable.
2Config error. check uses this for anything that does not parse.
3The named job does not exist.