Goal: make sure your OpenClaw deployment can be backed up, partially restored, and kept tidy over time.
Test backups and cleanup in staging first. Never destroy production state without a verified archive.
Execute each command, capture output, then note issues and fixes.
Create a default backup archive in the current directory:
openclaw backup create
Or send it to a dedicated backup folder:
openclaw backup create --output ~/Backups
Immediately verify archive integrity:
openclaw backup create --verify
For config-only backups (useful for GitOps):
openclaw backup create --only-config
openclaw backup createopenclaw backup create --output ~/Backupsopenclaw backup create --verifyopenclaw backup create --only-configPick a backup file (example path):
openclaw backup verify ./2026-03-09T00-00-00.000Z-openclaw-backup.tar.gz
This validates the manifest and ensures all declared payload files are present in the tarball.
openclaw backup verify ./2026-03-09T00-00-00.000Z-openclaw-backup.tar.gzList sessions for all agents:
openclaw sessions --all-agents
Preview cleanup impact without writing changes:
openclaw sessions cleanup --all-agents --dry-run
When you are comfortable with the plan, enforce it:
openclaw sessions cleanup --all-agents --enforce
Use JSON output if you want to wire this into a dashboard or CI:
openclaw sessions cleanup --all-agents --dry-run --json
openclaw sessions --all-agentsopenclaw sessions cleanup --all-agents --dry-runopenclaw sessions cleanup --all-agents --enforceopenclaw sessions cleanup --all-agents --dry-run --jsonDefine a simple weekly checklist such as:
openclaw backup create --output ~/Backupsopenclaw security audit --deep --json (store report)openclaw sessions cleanup --all-agents --dry-run followed by --enforce when safe.Document who runs these commands and where the logs/archives live so the practice survives team changes.
openclaw backup create --output ~/Backupsopenclaw security audit --deep --jsonopenclaw sessions cleanup --all-agents --dry-runTurn the commands on this page into your team runbook.