From 647a4d62abc2a407dd0d3c4d8cdd7acef97824aa Mon Sep 17 00:00:00 2001 From: quill Date: Wed, 28 Oct 2026 13:33:08 +0000 Subject: [PATCH] quill: cron migration runbook draft --- wizard-work/quill/cron-migration-runbook.md | 46 +++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 wizard-work/quill/cron-migration-runbook.md diff --git a/wizard-work/quill/cron-migration-runbook.md b/wizard-work/quill/cron-migration-runbook.md new file mode 100644 index 0000000..433d143 --- /dev/null +++ b/wizard-work/quill/cron-migration-runbook.md @@ -0,0 +1,46 @@ +# Hermes Cron Migration Runbook (Draft) +## Zero-downtime migration of cron jobs between Hermes profiles + +## Purpose +Move scheduled cron jobs from one Hermes profile to another without losing +executions or breaking the `deliver` target (telegram/email/local). + +## Scope +- Source profile: `/root/.hermes/cron/` (legacy shared location). +- Target profile: `/root/.hermes/profiles//cron/`. +- Applies to Hermes >= 0.9 with `cronjob_manage` tool. + +## Pre-flight +1. Export both profiles' cron lists: + - `cronjob_manage action='list'` on source. + - `cronjob_manage action='list'` on target (should be empty). +2. Verify target profile is active and can run foreground commands. +3. Confirm `deliver` destinations exist and are reachable (telegram chat id, email alias). +4. Snapshot source cron dir: `cp -a /root/.hermes/cron /root/.hermes/cron.snapshot.$(date +%s)`. + +## Migration steps +1. For each job in source: + a. Read its config (JSON/YAML on disk or via `cronjob_manage action='list'`). + b. Recreate on target with identical: + - `schedule` (cron5 or human string). + - `command` / `tool_call` payload. + - `deliver` target. + - `timezone` if present. + c. Run a manual trigger via `cronjob_manage action='run'` and confirm exit code 0. +2. Disable source jobs one by one only after target run succeeds. +3. Wait one full cycle (max 24 h) and compare delivery receipts on both sides. + +## Rollback +- If a target job fails, re-enable source job and stop migration. +- Remove the broken target job; do not leave half-migrated state. + +## Verification checklist +- [ ] `cronjob_manage action='list'` on target shows N jobs. +- [ ] `cronjob_manage action='list'` on source shows 0 enabled jobs. +- [ ] At least one manual trigger succeeded per migrated job. +- [ ] Delivery received on the configured channel. +- [ ] Source snapshot removed: `rm -rf /root/.hermes/cron.snapshot.*`. + +## Notes +- Do not edit source cron files by hand; use `cronjob_manage` only. +- Jobs with `persist_on_release=true` need a `background` flag check.