360 Secure SkillHub
360 安全技能中心

OpenClaw Backup (PhenixStar)

核心功能为备份OpenClaw的配置、凭据、工作区等关键数据,自动排除缓存和日志;支持手动备份、定时自动备份调度、数据恢复,且自动保留最近7份备份。典型场景:用户需创建OpenClaw备份、恢复数据、设置自动备份或管理备份轮转时使用。输入为操作指令,输出为压缩备份文件或操作执行结果。

phenixstar
phenixstar
热度 20.76
最近更新 2026-06-16 18:07:30
分类:自动化依赖:代码执行 / 读写文件应用场景:自动化脚本 / 任务管理 / 工作流

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add phenixstar-openclaw-backup
Metadata
name
openclaw-backup
description
Backup and restore OpenClaw data. Use when user asks to create backups, set up automatic backup schedules, restore from backup, or manage backup rotation. Handles ~/.openclaw directory archiving with proper exclusions.
license
MIT
version
1.0.0
homepage
https://github.com/PhenixStar/openclaw-skills-collection
user-invocable
true
disable-model-invocation
false
auto_activate
["backup openclaw","restore backup","create backup","schedule backup","backup rotation","openclaw backup","restore openclaw"]

OpenClaw Backup

Backup and restore OpenClaw configuration, credentials, and workspace.

Create Backup

Run the backup script:

./scripts/backup.sh [backup_dir]

Default backup location: ~/openclaw-backups/

Output: openclaw-YYYY-MM-DD_HHMM.tar.gz

What Gets Backed Up

  • openclaw.json — main config
  • credentials/ — API keys, tokens
  • agents/ — agent configs, auth profiles
  • workspace/ — memory, SOUL.md, user files
  • telegram/ — session data
  • cron/ — scheduled tasks

Excluded

  • completions/ — cache, regenerated automatically
  • *.log — logs

Setup Daily Backup with Cron

Use OpenClaw cron for daily backups with notification:

{
  "name": "daily-backup",
  "schedule": {"kind": "cron", "expr": "0 3 * * *", "tz": "UTC"},
  "payload": {
    "kind": "agentTurn",
    "message": "Run ~/.openclaw/backup.sh and report result to user."
  },
  "sessionTarget": "isolated",
  "delivery": {"mode": "announce"}
}

Restore

See references/restore.md for step-by-step restore instructions.

Quick restore:

openclaw gateway stop
mv ~/.openclaw ~/.openclaw-old
tar -xzf ~/openclaw-backups/openclaw-YYYY-MM-DD_HHMM.tar.gz -C ~
openclaw gateway start

Rotation

Script keeps last 7 backups automatically.