cron-backup
- Repo stars 0
- Author updated Live
- Author repo trackhub
- Domain
- Other
- Compatible agents
-
- Claude Code
- Cursor
- Cline
- Codex
- Windsurf
- Gemini CLI
- +20
- Trust score
- 88 / 100 · community maintained
- Author / version / license
- @track-org · no license declared
- Token usage
- Lean
- Setup complexity
- Plug-and-play
- External API key
- Not required
- Operating systems
- macOS · Linux · Windows
- Runtime requirements
- Node.js
- Permissions
-
- Read-only
- Write / modify
- Network behavior
- External requests
- Install commands
- 26 variants
Profile is derived at build time from SKILL.md and install vectors. Subject to drift from author intent.
Heads up: 未限定 allowed-tools,默认拥有全部工具权限。
---
name: cron-backup
description: Export OpenClaw cron job configurations as restorable JSON snapshots and import them back. Suppo…
category: other
runtime: Node.js
---
# cron-backup output preview
## PART A: Task fit
- Use case: Export OpenClaw cron job configurations as restorable JSON snapshots and import them back. Supports full fleet export, single-job export, diff-based restore, and backup rotation. Use when backing up cron configs before changes, migrating jobs between instances, recovering deleted jobs, or scheduling periodic cron fleet backups..
- Inputs: target material, constraints, expected output, and acceptance criteria.
- Evidence boundary: follow “Why / Scripts / Requirements” and do not present inference as author intent.
## PART B: Execution result
- **01** The card summarizes the use case; runtime output centers on “Export OpenClaw cron job configurations as restorable JSON snapshots and import them back. Supports full fleet export, single-job export, diff-based restore, and backup rotation. Use when backing up cron configs before changes, migrating jobs between instances, recovering deleted jobs, or scheduling periodic cron fleet backups.”.
- **02** When the source has headings, the agent prioritizes “Why / Scripts / Requirements” so the result follows the author’s structure.
- **03** Typical output includes task judgment, concrete steps, required commands or file edits, validation, and follow-up options.
- **04** Risk context follows the fingerprint: read files, write/modify files; may access external network resources; usually needs no extra API key.
## Running Rules
- read files, write/modify files; may access external network resources; usually needs no extra API key.
- Validate with a small sample before expanding scope.
- Return the result, validation criteria, and next iteration options. The source mentions slash commands such as `/tmp`, `/path`; use them first when your agent supports command triggers.
Name target files or source material, expected output, forbidden changes, and whether network or shell access is allowed. Permission fingerprint: read files, write/modify files.
Start with a small task and check whether the result follows “Why / Scripts / Requirements”. Inspect diffs, logs, previews, or tests before expanding scope.
Confirm the final output includes a concrete result, evidence, and next action. If it stays generic, tighten inputs, boundaries, and acceptance criteria.
---
name: cron-backup
description: Export OpenClaw cron job configurations as restorable JSON snapshots and import them back. Suppo…
category: other
source: track-org/trackhub
---
# cron-backup
## When to use
- Export OpenClaw cron job configurations as restorable JSON snapshots and import them back. Supports full fleet export…
- Use it when the task has clear inputs, repeatable steps, and validation criteria.
## What to provide
- Target material, scope, expected result, and forbidden changes.
- Whether network, commands, file writes, or external services are allowed.
## Execution rules
- Organize steps around “Why / Scripts / Requirements” and keep inference separate from source facts.
- read files, write/modify files; may access external network resources; usually needs no extra API key.
- Validate with a small sample before expanding the task.
## Output requirements
- Return the deliverable, key evidence, validation method, and next action.
- Mark missing information as unknown; do not invent commands, platforms, or dependencies. The author source anchors workflow facts; repository files anchor sources and commands; Fluxly only adds fit, limitations, and quality judgment.
skill "cron-backup" {
input -> user goal + target files + boundaries + acceptance criteria
context -> Why / Scripts / Requirements
rules -> SKILL.md triggers / order / output contract
runtime -> Node.js | read files, write/modify files | may access external network resources
guardrails -> usually needs no extra API key + small-sample validation + diff/log review
output -> copyable result + checklist + next iteration
} Cron Backup
Export and import OpenClaw cron job configurations as versioned JSON snapshots. Safe, idempotent, and designed for both manual and automated (heartbeat/cron) use.
Why
Cron job configs represent significant investment — schedules, payloads, delivery targets, and preflight checks are all hand-tuned. A misconfigured openclaw cron edit or accidental delete can wipe that work. This skill provides a safety net: point-in-time snapshots you can restore from.
Scripts
scripts/cron-backup.mjs— Zero dependencies. Node.js 18+.
Requirements
- Node.js 18+ (uses built-in
fetch,fs,path) openclawCLI available in PATH (foropenclaw cron list --json)
Usage
Export (create a backup)
# Full fleet backup (all jobs)
node cron-backup.mjs export
# Single job by ID or name
node cron-backup.mjs export --job "Solar export WhatsApp nudge"
node cron-backup.mjs export --job 2e0eb8eb-2192-4966-b6cf-f3c0046f901b
# Custom output directory
node cron-backup.mjs export --dir /tmp/my-backups
# Limit number of rotated backups (default: 10)
node cron-backup.mjs export --max-backups 5
Import (restore from backup)
# Show what would be restored (dry run)
node cron-backup.mjs import --dry-run
# Restore most recent backup
node cron-backup.mjs import
# Restore a specific backup file
node cron-backup.mjs import --file backups/cron-backup-2026-05-23T00-00-00.json
# Force restore even if current jobs match (overwrite)
node cron-backup.mjs import --force
# Restore a single job from backup
node cron-backup.mjs import --job "Solar export WhatsApp nudge"
List backups
# Show all available backups
node cron-backup.mjs list
# JSON output
node cron-backup.mjs list --json
Diff
# Compare current fleet vs most recent backup
node cron-backup.mjs diff
# Compare current fleet vs a specific backup
node cron-backup.mjs diff --file backups/cron-backup-2026-05-22T00-00-00.json
Backup Format
Each backup is a JSON file:
{
"schema": "cron-backup-v1",
"exportedAt": "2026-05-23T00:00:00.000Z",
"hostname": "raspberrypi",
"jobCount": 4,
"jobs": [
{
"id": "2e0eb8eb-...",
"name": "Solar export WhatsApp nudge",
"description": "...",
"enabled": true,
"schedule": { "kind": "cron", "expr": "0,30 6-21 * * *", "tz": "Europe/Dublin" },
"sessionTarget": "main",
"payload": { ... },
"delivery": { ... }
}
]
}
Jobs are exported without runtime state (state is excluded) — backups capture config, not history.
Import Behaviour
- By default, import is non-destructive: it only restores jobs that are missing from the current fleet (deleted jobs). Existing jobs are not modified unless
--forceis used. --force: overwrites existing jobs that differ from the backup. Shows a diff before proceeding.--dry-run: shows exactly what would be added/modified/deleted without making changes.- Import creates jobs via
openclaw cron addand updates viaopenclaw cron edit.
Rotation
- Default: keeps the last 10 backups per output directory
- Older backups are automatically cleaned up on export
- Use
--max-backupsto adjust
Flags
| Flag | Short | Default | Description |
|---|---|---|---|
--dir |
-d |
./backups |
Backup directory path |
--file |
-f |
(latest) | Specific backup file to import/diff |
--job |
-j |
(all) | Single job name or ID |
--max-backups |
-m |
10 | Max rotated backups to keep |
--dry-run |
false | Preview without changes | |
--force |
false | Overwrite existing on import | |
--json |
false | JSON output (list/diff) | |
--help |
Show usage |
Exit Codes
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | Error (missing args, file not found, etc.) |
| 2 | Dry-run showed changes that would be made |
Integration
Scheduled backup via cron
{
"name": "Weekly cron fleet backup",
"schedule": { "kind": "cron", "expr": "0 3 * * 0", "tz": "Europe/Dublin" },
"payload": {
"kind": "agentTurn",
"message": "Run: node /path/to/trackhub/skills/cron-backup/scripts/cron-backup.mjs export --max-backups 8\nReport the result briefly."
}
}
Pre-change safety net
Before editing a cron job manually:
node cron-backup.mjs export --job "my job name"
# ... make changes ...
# if something breaks:
node cron-backup.mjs import --force --job "my job name"
Decide Fit First
Design Intent
How To Use It
Boundaries And Review