← Back to Plugins
Tools

Workspace Backup

StressTestor By StressTestor 👁 11 views ▲ 0 votes

openclaw plugin for encrypted workspace backups to S3/R2/B2. day 14 of 20 days of claw.

GitHub

Install

openclaw plugins install -l

Configuration Example

{
  "plugins": {
    "workspace-backup": {
      "provider": "s3",
      "bucket": "my-openclaw-backups",
      "encryptionKey": "$BACKUP_KEY",
      "schedule": "0 */6 * * *",
      "s3": {
        "region": "us-east-1",
        "accessKeyId": "$AWS_ACCESS_KEY_ID",
        "secretAccessKey": "$AWS_SECRET_ACCESS_KEY"
      }
    }
  }
}

README

# workspace-backup

openclaw plugin for encrypted, scheduled workspace backups. supports S3, Cloudflare R2, and Backblaze B2. incremental file collection, AES-256 encryption, snapshot-based restore.

## install

```bash
openclaw plugins install -l .
```

## config

```json
{
  "plugins": {
    "workspace-backup": {
      "provider": "s3",
      "bucket": "my-openclaw-backups",
      "encryptionKey": "$BACKUP_KEY",
      "schedule": "0 */6 * * *",
      "s3": {
        "region": "us-east-1",
        "accessKeyId": "$AWS_ACCESS_KEY_ID",
        "secretAccessKey": "$AWS_SECRET_ACCESS_KEY"
      }
    }
  }
}
```

### options

| option | default | what it does |
|--------|---------|-------------|
| `provider` | `"s3"` | storage backend: `s3`, `r2`, or `b2` |
| `bucket` | - | bucket name (required) |
| `prefix` | `"openclaw-backups/"` | key prefix for all snapshots |
| `schedule` | `"0 */6 * * *"` | backup frequency (cron) |
| `encryptionKey` | - | AES-256 key (env var or literal) |
| `include` | `["**/*"]` | file globs to include |
| `exclude` | `["node_modules/**", ".git/**", "*.log"]` | file globs to exclude |
| `maxSnapshots` | `30` | max snapshots to retain |

### cloudflare R2

R2 is S3-compatible. use `"provider": "r2"` and set the `s3.endpoint` to your R2 URL.

### backblaze B2

```json
{
  "provider": "b2",
  "b2": {
    "applicationKeyId": "...",
    "applicationKey": "..."
  }
}
```

## tools

- **backup_now** - trigger immediate backup
- **backup_list** - list available snapshots
- **backup_restore** - restore from a snapshot
- **backup_config** - view current settings (secrets masked)
- **backup_status** - last backup time, schedule, provider info

## how it works

1. collects files from workspace (respecting include/exclude globs)
2. creates a JSON archive with base64-encoded file contents
3. encrypts with AES-256-CBC if encryption key is configured
4. uploads to configured storage provider
5. background service runs on cron schedule

restore downloads the snapshot, decrypts, and writes files back to workspace.

## day 14 of [20 days of claw](https://github.com/StressTestor)
tools

Comments

Sign in to leave a comment

Loading comments...