gitclaw-backup
Original:🇺🇸 English
Translated
GitHub backup for OpenClaw workspace. Use when user says "同步", "备份", "backup", "sync", "push to github", or asks about backup status/history/failures. Manages git-based full backup of ~/.openclaw to GitHub.
3installs
Added on
NPX Install
npx skill4agent add blessonism/openclaw-skills gitclaw-backupTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →GitClaw Backup
Full backup of to GitHub via git.
/home/node/.openclaw/Quick Reference
- Repo:
https://github.com/blessonism/openclaw-backup.git - Branch:
main - Script:
/home/node/.openclaw/gitclaw/auto_backup.sh - Cron: — 每天 UTC 16:00 (北京时间 0:00)
daily-workspace-backup - Exclude rules:
/home/node/.openclaw/.gitignore
Manual Sync
Run the backup script directly:
bash
bash /home/node/.openclaw/gitclaw/auto_backup.shScript behavior:
- Lock-based (prevents concurrent runs)
- Stages all changes (), respects
git add -A.gitignore - Skips commit if no changes
- Pushes to
origin main - Logs to
/home/node/.openclaw/gitclaw/backup.log
Post-Sync Response
After a successful sync, always include a clickable link to the latest commit in your reply:
bash
# Get the latest commit short hash
cd /home/node/.openclaw && git log --oneline -1Then format the response like:
✅ 同步完成 — 查看 commit
- If no changes were detected, report "无变更,跳过" (no link needed).
- If the push failed, report the error and suggest troubleshooting steps.
Check Status
bash
# Last backup log
tail -5 /home/node/.openclaw/gitclaw/backup.log
# Git status (uncommitted changes)
cd /home/node/.openclaw && git status --short
# Recent commits
cd /home/node/.openclaw && git log --oneline -5Exclude Files from Backup
Edit — standard gitignore syntax.
/home/node/.openclaw/.gitignoreCurrent notable exclusions: , , , , large binary files.
workspace/images/workspace/node_modules/workspace/.micromamba/workspace/bin/Troubleshooting
- "already running" in log → stale lock at , remove it:
/home/node/.openclaw/gitclaw/lock/rmdir /home/node/.openclaw/gitclaw/lock - Push rejected → likely force-push or diverged history on remote; check with
git log --oneline -5 origin/main - Auth failure → credentials in ; verify with
~/.git-credentialsgit credential fill <<< "host=github.com"