22 lines
462 B
Bash
22 lines
462 B
Bash
#!/bin/bash
|
|
# git-backup.sh - Quick backup of workspace to git
|
|
# Run this before deploying new images
|
|
|
|
cd /home/node/.openclaw/workspace
|
|
|
|
echo "=== OpenClaw Workspace Backup ==="
|
|
echo "Status:"
|
|
git status --short
|
|
|
|
echo ""
|
|
echo "Adding changes..."
|
|
git add -A
|
|
|
|
if git diff --cached --quiet; then
|
|
echo "Nothing to commit"
|
|
else
|
|
echo "Committing..."
|
|
git commit -m "Backup: $(date -Iseconds)"
|
|
echo "Done. Commit hash: $(git rev-parse --short HEAD)"
|
|
fi
|