OpenClaw Skill
Workspace Backup
Install
$npx clawhub@latest install workspace-backup
View on GitHubv1.0.0
All-time installs4
Active installs4
Stars0
๐พ Workspace Backup
Automated git-based backup of your OpenClaw workspace to GitHub. Designed to run as a cron job or on-demand.
Features
- One-command backup with auto-generated commit messages
- Smart
.gitignorefor OpenClaw workspaces - Timestamp + changed files summary in commits
- Restore from any point in history
- Cron-friendly (no TTY required)
Setup
1. Initialize the backup repo
bash
cd ~/.openclaw/workspace
git init
git remote add origin git@github.com:YOUR_USER/YOUR_REPO.git2. Ensure SSH keys are configured
The script uses SSH for push. Make sure your deploy key or SSH key is available.
3. Run the backup
bash
bash {baseDir}/scripts/backup.sh4. Schedule as cron job
In OpenClaw, create a cron job:
json
{
"name": "workspace-backup",
"schedule": "0 */6 * * *",
"command": "bash /home/node/.openclaw/workspace/skills/workspace-backup/{baseDir}/scripts/backup.sh",
"description": "Backup workspace to GitHub every 6 hours"
}Or via system crontab:
0 */6 * * * cd /home/node/.openclaw/workspace && bash skills/workspace-backup/{baseDir}/scripts/backup.sh >> /tmp/backup.log 2>&1
Restore Procedures
Restore entire workspace to latest backup
bash
cd ~/.openclaw/workspace
git fetch origin
git reset --hard origin/mainRestore a specific file from history
bash
git log --oneline -- path/to/file # find the commit
git checkout <commit-hash> -- path/to/file # restore itRestore to a specific point in time
bash
git log --oneline --before="2026-02-01" # find commit near that date
git checkout <commit-hash> # detached HEAD at that point
# Copy what you need, then: git checkout mainView what changed between backups
bash
git log --oneline -10
git diff <older-hash> <newer-hash> --stat.gitignore
The backup script auto-creates a .gitignore if missing, excluding:
.venv/โ Python virtual environments.data/โ Local databases and data files.envโ Secret environment variablesnode_modules/โ Node.js dependencies__pycache__/โ Python bytecode*.pycโ Compiled Python files.DS_Storeโ macOS metadata
Script Reference
| Script | Description |
|---|---|
{baseDir}/scripts/backup.sh | Main backup script โ add, commit, push |
Credits
Built by M. Abidi | agxntsix.ai YouTube | GitHub Part of the AgxntSix Skill Suite for OpenClaw agents.
๐ Need help setting up OpenClaw for your business? Book a free consultation
Created by
@aiwithabidiPersistent memory
Give your OpenClaw agent a memory layer
Mem0 remembers users and context across sessions so you send fewer tokens and get better answers.
Try Mem0Mem0 + OpenClaw guide