openclaw-backup
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.
Packaged view
This page reorganizes the original catalog entry around fit, installability, and workflow context first. The original raw source lives below.
Install command
npx @skill-hub/cli install openclaw-skills-openclaw-backup
Repository
Skill path: skills/alex3alex/openclaw-backup
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.
Open repositoryBest for
Primary workflow: Analyze Data & AI.
Technical facets: Full Stack, Data / AI.
Target audience: everyone.
License: Unknown.
Original source
Catalog source: SkillHub Club.
Repository owner: openclaw.
This is still a mirrored public skill entry. Review the repository before installing into production workflows.
What it helps with
- Install openclaw-backup into Claude Code, Codex CLI, Gemini CLI, or OpenCode workflows
- Review https://github.com/openclaw/skills before adding openclaw-backup to shared team environments
- Use openclaw-backup for development workflows
Works across
Favorites: 0.
Sub-skills: 0.
Aggregator: No.
Original source / Raw SKILL.md
---
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.
---
# OpenClaw Backup
Backup and restore OpenClaw configuration, credentials, and workspace.
## Create Backup
Run the backup script:
```bash
./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:
```json
{
"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](references/restore.md) for step-by-step restore instructions.
Quick restore:
```bash
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.
---
## Referenced Files
> The following files are referenced in this skill and included for context.
### references/restore.md
```markdown
# Restore OpenClaw from Backup
## Quick Restore
```bash
# 1. Stop OpenClaw
openclaw gateway stop
# 2. Backup current (safety)
mv ~/.openclaw ~/.openclaw-old
# 3. Extract backup
cd ~
tar -xzf ~/openclaw-backups/openclaw-YYYY-MM-DD_HHMM.tar.gz
# 4. Start OpenClaw
openclaw gateway start
# 5. Verify
openclaw status
```
## Rollback if Restore Fails
```bash
rm -rf ~/.openclaw
mv ~/.openclaw-old ~/.openclaw
openclaw gateway start
```
## What's in a Backup
```
~/.openclaw/
├── openclaw.json # Main config
├── credentials/ # API keys, tokens
├── agents/ # Agent configs, auth
├── workspace/ # Memory, SOUL.md, files
├── telegram/ # Telegram session
└── cron/ # Scheduled tasks
```
## Excluded from Backup
- `completions/` — API response cache (regenerated)
- `*.log` — Log files
```
### scripts/backup.sh
```bash
#!/bin/bash
# OpenClaw Backup Script
# Usage: ./backup.sh [backup_dir]
BACKUP_DIR="${1:-$HOME/openclaw-backups}"
DATE=$(date +%Y-%m-%d_%H%M)
BACKUP_FILE="$BACKUP_DIR/openclaw-$DATE.tar.gz"
mkdir -p "$BACKUP_DIR"
# Create backup (exclude completions cache and logs)
tar -czf "$BACKUP_FILE" \
--exclude='completions' \
--exclude='*.log' \
-C "$HOME" .openclaw/ 2>/dev/null
if [ $? -eq 0 ]; then
SIZE=$(du -h "$BACKUP_FILE" | cut -f1)
# Rotate: keep only last 7 backups
ls -t "$BACKUP_DIR"/openclaw-*.tar.gz 2>/dev/null | tail -n +8 | xargs -r rm
COUNT=$(ls "$BACKUP_DIR"/openclaw-*.tar.gz 2>/dev/null | wc -l)
echo "✅ Backup created: $BACKUP_FILE ($SIZE)"
echo "📁 Total backups: $COUNT"
exit 0
else
echo "❌ Backup failed"
exit 1
fi
```
---
## Skill Companion Files
> Additional files collected from the skill directory layout.
### _meta.json
```json
{
"owner": "alex3alex",
"slug": "openclaw-backup",
"displayName": "OpenClaw Backup",
"latest": {
"version": "1.0.0",
"publishedAt": 1770475997563,
"commit": "https://github.com/openclaw/skills/commit/d61e40463e9165d55420477861b44c0455213359"
},
"history": []
}
```