-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
[Feature]: cron jobs.d/ directory support (one file per job, for NixOS/GitOps declarative setups) #20950
Copy link
Copy link
Open
Labels
P3Low-priority cleanup, docs, polish, ergonomics, or speculative work.Low-priority cleanup, docs, polish, ergonomics, or speculative work.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.enhancementNew feature or requestNew feature or requestimpact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.This issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Description
Metadata
Metadata
Assignees
Labels
P3Low-priority cleanup, docs, polish, ergonomics, or speculative work.Low-priority cleanup, docs, polish, ergonomics, or speculative work.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.enhancementNew feature or requestNew feature or requestimpact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.This issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Type
Fields
Priority
None yet
Summary
All cron jobs are now in a single file. That makes GitOps difficult. Proposing to also have a directory (
jobs.d/?) for one file per job.Problem to solve
Cron jobs are stored in a single
~/.openclaw/cron/jobs.json. This makes declarative management painful in NixOS/GitOps setups — there's no clean way to symlink individual job definitions from a git repo, and a fresh deploy requires recreating jobs manually or via a custom merge script.Proposed solution
Support a jobs.d/ directory alongside (or instead of) jobs.json. Each *.json file in the directory represents one job — same schema as an entry in jobs.json. Gateway loads all files at startup.
Config:
With per-file storage, a NixOS activation script becomes trivial:
No merge scripts, no state management — just symlinks. This mirrors patterns already common in the ecosystem:
conf.d/, systemd drop-ins, nginxsites-enabled/, etc.Alternatives considered
Current workaround:
Using a Python activation script that merges declarative job definitions into
jobs.jsonon everynixos-rebuild switch, preserving runtime fields (id/createdAtMs/state) for existing jobs. Works, but more complexity than a first-class GitOps use case should need.Impact
Affected: user who wants to add/remove/edit cron jobs
Severity: annoying
Frequency: no tracking of cron jobs in git or complicated Python script to manage them
Consequence: difficulty tracking cron jobs in git
Evidence/examples
No response
Additional information
No response