# Send safe-backup to your agent
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
## Fast path
- Download the package from Yavira.
- Extract it into a folder your agent can access.
- Paste one of the prompts below and point your agent at the extracted folder.
## Suggested prompts
### New install

```text
I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete.
```
### Upgrade existing

```text
I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run.
```
## Machine-readable fields
```json
{
  "schemaVersion": "1.0",
  "item": {
    "slug": "safe-backup",
    "name": "safe-backup",
    "source": "tencent",
    "type": "skill",
    "category": "效率提升",
    "sourceUrl": "https://clawhub.ai/HackSing/safe-backup",
    "canonicalUrl": "https://clawhub.ai/HackSing/safe-backup",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadUrl": "/downloads/safe-backup",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=safe-backup",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "packageFormat": "ZIP package",
    "primaryDoc": "SKILL.md",
    "includedAssets": [
      "SKILL.md",
      "scripts/backup.sh"
    ],
    "downloadMode": "redirect",
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-30T16:55:25.780Z",
      "expiresAt": "2026-05-07T16:55:25.780Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
        "contentDisposition": "attachment; filename=\"network-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/safe-backup"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    }
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/safe-backup",
    "downloadUrl": "https://openagent3.xyz/downloads/safe-backup",
    "agentUrl": "https://openagent3.xyz/skills/safe-backup/agent",
    "manifestUrl": "https://openagent3.xyz/skills/safe-backup/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/safe-backup/agent.md"
  }
}
```
## Documentation

### Safe Backup

Backup OpenClaw state directory and workspace with security best practices.

### ⚠️ Security Warnings

Backup may contain sensitive data - review before sharing
If uploading to GitHub - use a private repository and consider encryption
auth-profiles.json is EXCLUDED - after restore, you must re-authenticate
This script does NOT automatically push to any remote

### 1. Run Backup

~/.openclaw/skills/safe-backup/scripts/backup.sh

### 2. Check Output

Backup file: /tmp/safe-backup-20260223.tar.gz  (Linux)
Backup file: /var/folders/xx/.../safe-backup-20260223.tar.gz  (macOS)
Backup file: C:\\Users\\xxx\\AppData\\Local\\Temp\\safe-backup-20260223.tar.gz  (Windows)

### 3. Store Securely

See "Storage Options" below.

### Platform Support

PlatformStatusRequirementsLinux✅ Fully supportedNative bashmacOS✅ Fully supportedNative bashWindows (Git Bash)✅ SupportedGit for WindowsWindows (WSL)✅ SupportedWSL Ubuntu/DebianWindows (Native CMD)❌ Not supportedRequires bash

### Important Notes for Migration

1. Temporary Directory Auto-Detection

The script automatically detects the appropriate temp directory for each platform:

PlatformTemp DirectoryEnvironment VariableLinux/tmp-macOS/var/folders/xx/...$TMPDIRWindows (Git Bash)C:\\Users\\xxx\\AppData\\Local\\Temp$TEMP / $TMP

2. rsync Dependency

The script uses rsync for efficient file copying:

Linux/macOS: ✅ Built-in
Windows: ⚠️ Git Bash includes rsync

If rsync is not available, the script will fail. For Windows without Git Bash, you need to install rsync separately (e.g., via MSYS2 or Cygwin).

3. Path Separators

The script uses Unix-style forward slashes (/). This works in:

Linux ✅
macOS ✅
Git Bash ✅
WSL ✅

Native Windows CMD uses backslashes (\\) and won't work without modifications.

4. Home Directory Detection

The script uses $HOME environment variable:

Linux: /home/username
macOS: /Users/username
Windows (Git Bash): C:\\Users\\username

This works correctly in all supported platforms.

### Migration Checklist

When migrating from one platform to another:

Run backup on source machine
 Transfer backup file securely (USB, encrypted cloud, etc.)
 Install Git Bash (Windows) or ensure bash is available
 Install OpenClaw on target machine
 Run restore script
 Re-authenticate all services (credentials are not backed up)

### Platform-Specific Notes

Windows (Git Bash)

# Run from Git Bash, NOT CMD or PowerShell
~/.openclaw/skills/safe-backup/scripts/backup.sh

If you get "rsync not found", install Git for Windows with all optional Unix tools.

macOS

# Native bash is available
~/.openclaw/skills/safe-backup/scripts/backup.sh

Temp directory will be in $TMPDIR (e.g., /var/folders/xx/...).

Linux

# Native bash is available
~/.openclaw/skills/safe-backup/scripts/backup.sh

Temp directory will be /tmp.

### ✅ Included (Safe to Backup)

DirectoryContents~/.openclaw/OpenClaw configuration~/.openclaw/workspace/Agent workspace filesagents/Agent definitionsskills/Installed skillsmemory/Memory fileshooks/Custom hooks

### ❌ Excluded (Sensitive - Not Backed Up)

PatternReason*.logLog files*.log.*Log rotation filessessions.jsonSession datalogs/Log directoryauth-profiles.jsonAPI tokens & credentials.envEnvironment variables*.pem, *.keyTLS/SSH keyscredentials.jsonStored credentialsapi-keys.jsonAPI keyssessions/Runtime sessionsbrowser/Browser cachecanvas/Canvas cachemedia/Temporary media filesbackups/Backup directory itselfdelivery-queue/Runtime queuedevices/Device cachesubagents/Runtime subagentscompletions/Auto-completion cache*.bakBackup files*.saveSave filesupdate-check.jsonUpdate check cache

### Use Cases

ScenarioRecommended SolutionDescriptionRegular BackupLocal encrypted storageWeekly backup, store in encrypted local directoryMigrate to New MachineLocal tarball + USBTransfer between machines, avoid network transmissionCloud Disaster RecoveryPrivate GitHub repoPrivate repo + encryption, for offsite backupServer Environmentrsync to backup serverAutomated periodic sync, suitable for production

### Phase 1: Backup

# Step 1: Run backup
~/.openclaw/skills/safe-backup/scripts/backup.sh

# Step 2: Find output path (check the last line of output)
# The script will display: "Backup file: /path/to/safe-backup-YYYYMMDD.tar.gz"

# Step 3: Verify backup contents
tar -tzf "$(ls -t /tmp/safe-backup-*.tar.gz | head -1)" | head -20

# Or use the exact path shown in output:
# tar -tzf /tmp/safe-backup-20260223.tar.gz | head -20

### Phase 2: Storage

Choose one:

Option A: Local Encrypted Storage (Recommended)

# Find the latest backup file
BACKUP_FILE=$(ls -t /tmp/safe-backup-*.tar.gz | head -1)

# Create encrypted archive
openssl enc -aes-256-cbc -salt -in "$BACKUP_FILE" -out ~/backups/safe-backup-$(date +%Y%m%d).tar.gz.enc

# Enter a strong password when prompted

# Delete unencrypted backup
rm "$BACKUP_FILE"

Option B: Private GitHub Repository

# One-time setup: Create private repo on GitHub

# Find the latest backup file
BACKUP_FILE=$(ls -t /tmp/safe-backup-*.tar.gz | head -1)

# Clone your private repo
git clone https://github.com/YOUR_USERNAME/safe-backup.git ~/safe-backup

# Extract backup
mkdir -p ~/safe-backup/$(date +%Y-%m-%d)
tar -xzf "$BACKUP_FILE" -C ~/safe-backup/$(date +%Y-%m-%d)/

# Commit and push
cd ~/safe-backup
git add .
git commit -m "Backup $(date +%Y-%m-%d)"
git push origin main

# Delete local copy
rm -rf ~/safe-backup
rm "$BACKUP_FILE"

Option C: rsync to Remote Server

# Example: sync to remote server
rsync -avz --delete \\
  --exclude='*.log' \\
  --exclude='sessions.json' \\
  ~/.openclaw/ user@backup-server:/path/to/backups/

### Phase 3: Restore

Step 1: Locate Backup

# If encrypted
openssl enc -aes-256-cbc -d -in ~/backups/safe-backup-20260223.tar.gz.enc -out /tmp/safe-backup.tar.gz

# If plain tarball, find the file
# Check your backup location (USB, cloud download, etc.)
cp /path/to/your/backup/safe-backup-20260223.tar.gz /tmp/

Step 2: Stop Gateway

systemctl --user stop openclaw-gateway

Step 3: Restore Files

# Determine temp directory based on platform
if [[ -n "$TMPDIR" ]]; then
    TEMP_DIR="$TMPDIR"
elif [[ -n "$TEMP" ]]; then
    TEMP_DIR="$TEMP"
elif [[ -n "$TMP" ]]; then
    TEMP_DIR="$TMP"
else
    TEMP_DIR="/tmp"
fi

# Extract to temporary location
mkdir -p "$TEMP_DIR/restore"
tar -xzf "$TEMP_DIR/safe-backup.tar.gz" -C "$TEMP_DIR/restore"

# Restore state directory
cp -r "$TEMP_DIR/restore/state/"* ~/.openclaw/

# Restore workspace (if needed)
cp -r "$TEMP_DIR/restore/workspace/"* ~/.openclaw/workspace/

Step 4: Re-authenticate

Because auth-profiles.json was excluded, you must re-configure:

# Edit config to add authentication
openclaw config edit

# Or manually create auth-profiles.json
nano ~/.openclaw/agents/main/agent/auth-profiles.json

Required re-configuration:

Telegram bot token
Discord bot token
Feishu credentials
Any other API keys

Step 5: Restart Gateway

systemctl --user start openclaw-gateway

# Verify
openclaw status

### Environment Variables

VariableDefaultDescriptionOPENCLAW_STATE_DIR$HOME/.openclawOpenClaw state directoryOPENCLAW_WORKSPACE_DIR$HOME/.openclaw/workspaceWorkspace directory

Example:

OPENCLAW_STATE_DIR=/data/openclaw ~/.openclaw/skills/safe-backup/scripts/backup.sh

### "State directory not found"

# Check if OpenClaw is installed
ls -la ~/.openclaw

### "Permission denied"

# Run with appropriate permissions
chmod +x ~/.openclaw/skills/safe-backup/scripts/backup.sh

### "rsync not found" (Windows)

# Install Git for Windows with Unix tools, or use WSL
# Alternatively, install rsync via MSYS2:
# pacman -S rsync

### Restore Fails

# Check backup integrity
tar -tzf /path/to/your/backup.tar.gz

# If encrypted, verify password
openssl enc -aes-256-cbc -d -in backup.enc -o /dev/null

### Best Practices

Backup regularly - at least weekly
Test restore - periodically verify backups work
Store offsite - keep backup in different location
Encrypt - never store unencrypted backups in cloud
Document - keep notes on what was re-configured after restore
## Trust
- Source: tencent
- Verification: Indexed source record
- Publisher: HackSing
- Version: 1.0.5
## Source health
- Status: healthy
- Source download looks usable.
- Yavira can redirect you to the upstream package for this source.
- Health scope: source
- Reason: direct_download_ok
- Checked at: 2026-04-30T16:55:25.780Z
- Expires at: 2026-05-07T16:55:25.780Z
- Recommended action: Download for OpenClaw
## Links
- [Detail page](https://openagent3.xyz/skills/safe-backup)
- [Send to Agent page](https://openagent3.xyz/skills/safe-backup/agent)
- [JSON manifest](https://openagent3.xyz/skills/safe-backup/agent.json)
- [Markdown brief](https://openagent3.xyz/skills/safe-backup/agent.md)
- [Download page](https://openagent3.xyz/downloads/safe-backup)