Cron tab: crontabs, cron.d, user crontabs, run-parts dirs and systemd timers in one list; next/last run, run now, enable/disable, in-place editing, cron log and output file

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
Mitchell-Johnson
2026-09-17 16:21:35 -07:00
co-authored by Claude Fable 5.1
parent bc891b1042
commit 41c2f05535
12 changed files with 1415 additions and 9 deletions
+13 -2
View File
@@ -123,8 +123,19 @@ something long in one, switch away and back, refresh — it's all still there.
`tmux new -A -s hamlab-<id>`; needs `mouse on` and status-bar handling in xterm.
- **Services tab** — `systemctl list-units`, per-unit page: status, last 200 journal
lines (live-tail via WS), start/stop/restart/enable buttons, unit file viewer.
- **Cron tab** — parse `/etc/crontab`, `/etc/cron.d/*`, user crontabs, and systemd
timers into one table with next-run times; edit via `crontab -` round-trip.
- **Cron tab** — **shipped 2026-09-17** (`internal/cron`, `Cron.tsx`): one list built
from `/etc/crontab`, `/etc/cron.d/*`, every user crontab (via sudo), the scripts in
the `run-parts` directories those drive, plus systemd timers. Next run computed by an
in-house cron-expression evaluator (tested: ranges, steps, names, dom-OR-dow rule,
`@` aliases); last run from the journal's `(user) CMD (command)` lines (cron logs via
syslog to journald; reading needs sudo/adm). Commented-out jobs show as disabled;
job-shaped lines inside comment blocks (Debian's header examples) are ignored. Per
job: Run now (background, as the job's user, `sh -c` with crontab `%` rules, output
captured), Enable/Disable (comments the line in place, refuses if the file changed
underneath), Edit source (textarea; validated line-by-line; user crontabs installed
with `crontab -`, system files written via `sudo tee`), Cron log, and Output file
when the command redirects to one. Timers: Run now (starts the activated service),
start/stop/enable/disable, live logs of the service via the Services tab's tail.
- **ZFS tab** — pools, datasets (`used/avail/refer/usedbysnapshots`), snapshot list,
scrub status, and the `freeing` counter. `grid` is the target, which implies
multi-host.