Add system cron discovery and management; bump to 0.2.0 #1

Merged
mdaleo404 merged 1 commits from cron-fix into main 2026-09-26 07:48:04 +00:00
Owner

schedls only ever read the invoking user's crontab, so jobs in
/etc/cron.d (and /etc/crontab, periodic dirs, other users' spools)
were invisible. This adds full discovery and management of system cron.

Changes

  • Parse system crontabs (min hour dom mon dow USER command) and
    @nickname USER command; skip dotted/hidden /etc/cron.d names.
  • Discover /etc/crontab, /etc/cron.d/*, /etc/cron.{hourly,daily, weekly,monthly}/*, and other users' spool crontabs as root. Jobs are
    named <file>:<line>, <script> or <user>:<line>.
  • new --cron --system writes an atomic, root-owned
    /etc/cron.d/schedls-<name> drop-in; rm removes only marker-matching
    drop-ins. --run-as USER sets the run-as account (default root).
  • Interactive new -i now asks for scope and, for system cron, run-as.
  • show/JSON expose the run-as user; doctor reports system cron files.
  • Docs updated (cron, CLI, architecture, security model, README).

Testing

  • New unit tests cover system parsing, discovery, plans, file-mode
    apply/rollback, CLI rules and the interactive wizard; integration
    tests cover real system discovery and a root-gated lifecycle.
  • Manual: schedls --backend cron now lists /etc/cron.d and periodic
    jobs on a host with system cron.
`schedls` only ever read the invoking user's crontab, so jobs in `/etc/cron.d` (and `/etc/crontab`, periodic dirs, other users' spools) were invisible. This adds full discovery and management of system cron. ## Changes - Parse system crontabs (`min hour dom mon dow USER command`) and `@nickname USER command`; skip dotted/hidden `/etc/cron.d` names. - Discover `/etc/crontab`, `/etc/cron.d/*`, `/etc/cron.{hourly,daily, weekly,monthly}/*`, and other users' spool crontabs as root. Jobs are named `<file>:<line>`, `<script>` or `<user>:<line>`. - `new --cron --system` writes an atomic, root-owned `/etc/cron.d/schedls-<name>` drop-in; `rm` removes only marker-matching drop-ins. `--run-as USER` sets the run-as account (default `root`). - Interactive `new -i` now asks for scope and, for system cron, run-as. - `show`/JSON expose the run-as user; doctor reports system cron files. - Docs updated (cron, CLI, architecture, security model, README). ## Testing - New unit tests cover system parsing, discovery, plans, file-mode apply/rollback, CLI rules and the interactive wizard; integration tests cover real system discovery and a root-gated lifecycle. - Manual: `schedls --backend cron` now lists `/etc/cron.d` and periodic jobs on a host with system cron.
mdaleo404 added 1 commit 2026-09-26 07:45:51 +00:00
Add system cron discovery and management; bump to 0.2.0
CI / test (3.11) (pull_request) Successful in 48s
CI / test (3.13) (pull_request) Successful in 54s
58d8d0f378
mdaleo404 merged commit 508fb3868a into main 2026-09-26 07:48:04 +00:00
mdaleo404 deleted branch cron-fix 2026-09-26 07:48:04 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mdaleo404/schedls#1