Repository navigation
fix(cron): support standard 5-field crontabs, validate schedules, and improve schedule descriptions - #596
Open
madejackson wants to merge 1 commit into
Open
fix(cron): support standard 5-field crontabs, validate schedules, and improve schedule descriptions#596madejackson wants to merge 1 commit into
madejackson wants to merge 1 commit into
Conversation
madejackson
force-pushed
the
feat/better-crontab-support
branch
2 times, most recently
from
September 8, 2026 18:44
2b6aa4d to
2d49763
Compare
madejackson
force-pushed
the
feat/better-crontab-support
branch
2 times, most recently
from
October 9, 2026 11:35
9b8cc4b to
b0b58c1
Compare
madejackson
force-pushed
the
feat/better-crontab-support
branch
from
October 12, 2026 07:18
b0b58c1 to
3d41da5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
fixes #554
Three related fixes for the scheduled jobs (cron) feature.
1. Support standard 5-field crontabs + validate schedules (
src/cron/crontab.go)The scheduler previously forced every crontab through gocron's
withSeconds=trueparser, which requires exactly 6 fields. Any standard 5-field expression (0 2 * * *) failed to parse and was silently dropped from the schedule (only logged as aMajorError), so those jobs never ran. The UI helper had the same 6-field-only assumption.This introduces a dual-format scheme:
minute hour dom month dow)@daily,@every 10m, …) andCRON_TZ=/TZ=prefixesInvalid/ambiguous expressions are now rejected loudly instead of silently never running.
All stored crontabs are normalized to the canonical 6-field form:
/api/croncreate/update validate + normalize (newCR013/CR014/CR023/CR024)BCK008/BCK009)UI:
crontabToTextunderstands 5-field, 6-field, descriptors and TZ prefixesisValidCrontabhelper with inline validation on the cron job, backup, and snapraid dialogsTests:
NormalizeCrontab/ValidCrontabunit tests (src/cron/crontab_test.go).2. Rewrite crontab descriptions + let them wrap in tables (
client/src/utils/indexs.js)crontabToTextpreviously produced redundant, zero-heavy output such as "Every day, Every day at 3 hours and 0 min and 0 sec" for0 0 3 * * *. Rewritten to emit concise natural-language descriptions:0 0 3 * * **/5 * * * *0 12 * * 1-530 4 1,15 * *0 0 4 */2 * *@daily,@every 90m) andTZ=prefixes workingDescriptions can be long, so the schedule column now wraps (
white-space: normal+break-word) in the cron jobs, backups, SnapRAID parity tables, and the backup overview info blocks — instead of being clipped by the defaultnowraptable cell.3. Keep TextField labels above prefilled values in the cron job dialog (
client/src/pages/cron/newJob.jsx)When editing a cron job that already has a
Command(orCrontab) value, the MUI outlined field's floating label overlapped the value because the label only shrinks on focus/useFormikmount, but the edit path populates the value asynchronously viaformik.setValues()after mount. The label now stays shrunk whenever the field already holds a value, so the descriptive label sits above the text instead of overlapping it.Verification
go build ./...✅go test ./src/cron/...✅npm run client-build(vite) ✅All 3 commits are cherry-picked onto the current
azukaar/Cosmos-Server:unstable(0b5a43e).