Repository navigation
Release Notes
v0.2.0
libcron
- Expressions accept month and weekday names, Sunday as
7, the@yearly,
@monthly,@weekly,@daily, and@hourlymacros, anda/nsteps, and
reject days that can never occur, such as0 0 31 2 *. Expression.parseWithDiagnosticsnames the failing field with a short
message.- Jobs follow their time zone's wall clock across DST changes and clock steps:
a repeated hour or a clock set back reruns only jobs whose minute or hour
field starts with*, a jump ahead of up to three hours runs each skipped
fixed-time match once under the job's overlap policy, and longer jumps are
taken as the new time.Expression.nextInstantanswers when a job fires
next. TimeZone.loadreads zones such asEurope/Parisfrom the system database;
toLocalandnextTransitionare public.- Jobs can be added, replaced, removed, paused, and unpaused while
Scheduler.runis active.replacekeeps a job's id, pause, and running
invocations, andJobOptions.pausedadds a job paused. Breaking:add
andremovetake anIo, andremoveno longer fails. - Commands run in their own process group; cancellation sends SIGTERM, then
SIGKILL afterJobOptions.termination_grace(10 seconds by default). - Breaking:
Outcomecarries durations and gainsdispatch_error;
Outcome.formatdescribes it.Invocation.scheduled_unix_minuteis now
scheduled_unix_seconds.RunErrorisCanceledorAlreadyRunning. Observer.inittakes a typed context,Command.validateruns the checks
addmakes, andDateTimeformats with{f}.Expression.nextnow takes under 50 ns for every schedule we measured: up
to 27 times faster for sparse ones such as0 0 29 2 *, and a few
nanoseconds (about 2x) slower for dense ones such as* * * * *.
CLI
- Daemon state moves out of the project to
~/.croner/run/<hash>/, or
$CRONER_HOME/run/<hash>/, which also fixesNameTooLongfrom deep
directories. croner enableandcroner disablestart the daemon at login and restart
it after a crash through launchd or systemd user units. The systemd path is
unit-tested and cross-compiled but has not yet run on a real Linux system.- Pauses survive daemon restarts, crashes, and reboots, and follow the job ID
across reloads. - Jobs take an optional
time_zone; UTC remains the default. croner next [id] [--count n]shows each job's next fire times with their
UTC offsets, computed the way the scheduler handles DST changes.- One scheduler runs every job, and
reloadcompares jobs by ID: unchanged
jobs are left alone and changed ones are replaced in place, keeping their
pause.croner stop <id>lets a run in progress finish. - The log has one line per event with an ISO-8601 UTC time, the job, and the
outcome, such asexited with code 7 after 1.5s. - Errors are sentences that name the file, job, and field, including the
failing schedule field. - Output redirected to a file no longer overwrites itself, and any
$schema
value is accepted.
v0.1.0 (Initial Release)
Cron scheduling for Zig, in-process or from a single croner.json.
- Parse and evaluate familiar five-field cron expressions.
- Schedule callbacks or direct child processes with
libcron. - Control timezones, overlap behavior, and cancellation.
- Manage command jobs with
setup,start,stop,list,reload, andlogs. - Validate configurations with the published JSON Schema.
The CLI supports macOS and Linux and schedules jobs in UTC.
libcron has no runtime dependencies.