Version: 1.0.15
Backs up your OpenClaw customizations (memory, config, skills, workspace) to an rclone destination on a schedule (Google Drive by default). Works on macOS, Linux, and Windows (via Git Bash or WSL).
GitHub repository: https://github.com/vidarbrekke/ClawBackup
- Clawd memory — your project memory folder
- OpenClaw config —
openclaw.json, skills, modules, workspace, cron jobs - Clawd scripts — backup script, LaunchAgent plist (macOS)
- CursorApps/clawd — includes active skills and related files (excluding
node_modules)
- Node.js — Download (for running setup)
- rclone — Download and configured for Google Drive (only required in
rcloneupload mode) - Bash — included on macOS/Linux; use Git Bash on Windows. If you use WSL, run setup inside your WSL terminal (e.g.
node setup.jsfrom WSL), not from Windows PowerShell, so paths are generated for Linux.
Review the repository code before running setup:
git clone https://github.com/vidarbrekke/ClawBackup.git
cd ClawBackup
# optional: checkout a tag or pinned commit before running
node setup.jsThis downloads and executes setup immediately. Use only if you trust the source:
curl -fsSL https://raw.githubusercontent.com/vidarbrekke/ClawBackup/main/setup.js | node- Run the setup (using Option A or B above).
- Answer the prompts. Press Enter to accept the default in brackets. All paths use your system’s home directory and what you type — nothing is hardcoded to a specific username.
- The setup writes a customized
backup_enhanced.shinto your project’sscripts/folder (paths are resolved to absolute so cron/launchd work from any working directory). - Choose upload mode:
rclone(default): upload archives to your remote destination.local-only: keep backups locally, skip cloud transfer.
- If you chose
launchd(macOS) orcron(Linux), follow the printed commands to enable scheduled backups. Setup now prompts for schedule hour/minute.
To regenerate the backup script and plist with default paths only (no prompts), run node setup.js --defaults.
-
Configure rclone for Google Drive:
rclone config
Create a remote (e.g.
googleDrive) and complete the OAuth flow. -
Test a backup:
~/clawd/scripts/backup_enhanced.sh(Use the path the setup printed for your system.)
- Backups can contain sensitive data from
~/.openclaw, project config, memory, and skills. - Setup and scheduling modify your local environment (LaunchAgent/cron/Task Scheduler) and create recurring jobs.
- In
rclonemode, cloud credentials are provided by your existingrclone config; no new env vars are required by this repo. - Prefer encrypted storage:
- use an encrypted destination (e.g.
rclone crypt), or - encrypt archives locally before offsite storage (e.g. age/gpg workflow).
- use an encrypted destination (e.g.
- Each backup now writes a checksum file (
.sha256) next to the archive for integrity verification.
- macOS:
launchctl unload ~/Library/LaunchAgents/com.openclaw.backup.plist - Linux: remove the backup line from
crontab -e - Windows: remove/disable the Task Scheduler task you created
Each archive includes a RESTORE_NOTES.txt file with the exact restore targets
based on your configured paths. In general:
openclaw_config/skills→~/.openclaw/skillscursorapps_clawd/skills→~/Dev/CursorApps/clawd/skills(or your chosen path)openclaw_config/*→~/.openclaw/clawd_scripts/*→~/clawd/scripts/root_md_files/*→ project root
- macOS: The setup generates a LaunchAgent plist. Install with the printed commands (copy to
~/Library/LaunchAgents/andlaunchctl load— no sudo for the agent). Or run the universal installer:./install-launchagent.sh(it searches common locations; if your project is elsewhere, pass the plist path:./install-launchagent.sh /path/to/com.openclaw.backup.plist). If you had an old system-wide daemon, the installer may ask for your password once to remove it. Backup runs at the hour/minute configured during setup. - Linux: Add the printed cron line to
crontab -e. - Windows: Use Task Scheduler to run the backup script daily via Git Bash or WSL.
- Backup fails or rclone “remote not found”: Run
rclone configand ensure the remote name matches what you entered at setup (e.g.googleDrive). On macOS, use the LaunchAgent (not LaunchDaemon) so the job runs as your user and sees~/.config/rclone. - Paths wrong after moving home/project: Run
node setup.jsagain with the new paths, then reinstall the scheduler (e.g../install-launchagent.shon macOS). - Check logs: Local backup log:
$LOCAL_BACKUP_DIR/backup.log; launchd stdout/stderr:$LOCAL_BACKUP_DIR/launchd.logandlaunchd.err(paths from your setup).
- Add workspace include modes (
full|minimal|off) so users can tune backup size and sensitivity for~/.openclaw/workspace*.
- Add optional remote verification mode (presence/size/checksum validation after upload).
- Add stricter remote retention safety checks (safe destination prefix by default, explicit override when needed).
- Enrich
manifest.jsonwith ClawBackup git commit hash and top-level staged sections. - Add launchd polish options (
RunAtLoad,WorkingDirectory) while keeping current defaults stable. - Add destination examples/presets in setup/docs for common
rcloneremotes (Dropbox, OneDrive, Box, S3).
- Add a
restore.shhelper (dry-run by default) to make restores safer and easier. - Introduce a storage-provider abstraction (keep
rcloneas default, allow provider-skill adapters later).
Critical behavior tests are included for setup/runtime generation logic.
Run:
node --test tests/*.test.jsTo reduce oversights when editing this repo (e.g. destructive ops, path edge cases), this repo includes a Cursor rule: .cursor/rules/safety-destructive-ops.mdc. You can copy that file into your OpenClaw or clawd project’s .cursor/rules/ so the same checks apply there.
This repo includes a VERSION file and an update script. To auto-update the
version on every commit, enable the local git hook:
git config core.hooksPath .githooksThis runs scripts/update-version.sh --next before each commit and updates
VERSION, README.md, and SKILL.md.
MIT