2.0 KiB
2.0 KiB
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/<name>/cron/. - Applies to Hermes >= 0.9 with
cronjob_managetool.
Pre-flight
- Export both profiles' cron lists:
cronjob_manage action='list'on source.cronjob_manage action='list'on target (should be empty).
- Verify target profile is active and can run foreground commands.
- Confirm
deliverdestinations exist and are reachable (telegram chat id, email alias). - Snapshot source cron dir:
cp -a /root/.hermes/cron /root/.hermes/cron.snapshot.$(date +%s).
Migration steps
- 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_callpayload.delivertarget.timezoneif present. c. Run a manual trigger viacronjob_manage action='run'and confirm exit code 0.
- Disable source jobs one by one only after target run succeeds.
- 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_manageonly. - Jobs with
persist_on_release=trueneed abackgroundflag check.