automation-conventions.md
/home/ubuntu/.openclaw/workspace/docs/automation-conventions.md
Automation conventions (cron jobs)
Rule of thumb
If a script exists primarily to support an OpenClaw Gateway cron job (or periodic automation), it should live under:
/home/ubuntu/.openclaw/workspace/automation/**
This keeps cron automation discoverable and avoids random scripts accumulating in the workspace root.
Exceptions
Keep scripts inside their project repo when the cron job is really running that project’s own pipeline, e.g.:
/home/ubuntu/projects/ai-compass/scripts/**/home/ubuntu/projects/openclaw-dashboard/**
In other words: if the cron job is operating on / committing to another repo, prefer that repo’s scripts/ directory.
Practical guidance
- Prefer explicit absolute paths in cron payloads.
- If you reorganize automation scripts, update the cron payloads in the same change.
- If you’re not sure whether a script is still used, search:
/home/ubuntu/.openclaw/cron/jobs.jsoncron listoutput payloads- and
grep -Rinworkspace/+ relevant/home/ubuntu/projects/*repos.
Committing cron definitions
Git doesn’t track the contents of symlink targets, so committing a symlink to the live cron store won’t capture changes.
Instead, keep a tracked snapshot in this repo:
- Snapshot file:
cron/jobs.snapshot.json - Sync script:
automation/cron-snapshot/sync-cron-snapshot.sh
Run the sync script after editing cron jobs, then commit the updated snapshot.