目标:让你的 OpenClaw 部署具备「可备份、可恢复、可定期清理」的运维能力。
先在预发环境验证备份与清理流程,确认无误后再推广到生产。
每一步都先执行命令,再记录结果和问题。
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 --json可以定义一份简单的周例行清单,例如:
openclaw backup create --output ~/Backupsopenclaw security audit --deep --json (store report)openclaw sessions cleanup --all-agents --dry-run followed by --enforce when safe.把由谁执行、日志/备份放在哪里写清楚,确保流程不会因为人员变动而丢失。
openclaw backup create --output ~/Backupsopenclaw security audit --deep --jsonopenclaw sessions cleanup --all-agents --dry-run