- Default one-shot jobs to delete after success, improving job management. - Introduced `--keep-after-run` CLI option to allow users to retain one-shot jobs post-execution. - Updated documentation to clarify default behaviors and new options for one-shot jobs. - Adjusted cron job creation logic to ensure consistent handling of delete options. - Enhanced tests to validate new behaviors and ensure reliability. This update streamlines the handling of one-shot jobs, providing users with more control over job persistence and execution outcomes.
44 lines
1.1 KiB
Markdown
44 lines
1.1 KiB
Markdown
---
|
||
summary: "CLI reference for `openclaw cron` (schedule and run background jobs)"
|
||
read_when:
|
||
- You want scheduled jobs and wakeups
|
||
- You’re debugging cron execution and logs
|
||
title: "cron"
|
||
---
|
||
|
||
# `openclaw cron`
|
||
|
||
Manage cron jobs for the Gateway scheduler.
|
||
|
||
Related:
|
||
|
||
- Cron jobs: [Cron jobs](/automation/cron-jobs)
|
||
|
||
Tip: run `openclaw cron --help` for the full command surface.
|
||
|
||
Note: isolated `cron add` jobs default to `--announce` delivery. Use `--deliver` for full output
|
||
or `--no-deliver` to keep output internal. To opt into the legacy main-summary path, pass
|
||
`--post-prefix` (or other `--post-*` options) without delivery flags.
|
||
|
||
Note: one-shot (`--at`) jobs delete after success by default. Use `--keep-after-run` to keep them.
|
||
|
||
## Common edits
|
||
|
||
Update delivery settings without changing the message:
|
||
|
||
```bash
|
||
openclaw cron edit <job-id> --announce --channel telegram --to "123456789"
|
||
```
|
||
|
||
Disable delivery for an isolated job:
|
||
|
||
```bash
|
||
openclaw cron edit <job-id> --no-deliver
|
||
```
|
||
|
||
Deliver full output (instead of announce):
|
||
|
||
```bash
|
||
openclaw cron edit <job-id> --deliver --channel slack --to "channel:C1234567890"
|
||
```
|