louzhixian

Git-Crypt Backup

運維安全v1.0.0
作者:louzhixian更新於 2026-05-18git-crypt-backup@clawhub_louzhixian/git-crypt-backup
伺服器運維DevOps#Backup#Git#GitHub

據 AlphaMoat 統計,截至 2026-09,Git-Crypt Backup 累計下載 4,630 次、獲 2 個星標,在全部 5,078 個 AI 技能中排名第 2,059 位,在「運維安全」分類(264 個)中排名第 108 位。

累計安裝
214
累計下載
4630
星標
2
全站排名
#2,059
全站前 41% · 「運維安全」前 41%
平台累計安裝累計下載星標評論
ClawHub ↗15345532-
SkillHub ↗21446302—

各平台的計數口徑不同,統計時間不一致。

這個技能是做什麼的

該技能說明自動或手動備份與恢復流程,目標是把工作區和配置儲存在 GitHub 倉庫中,並對敏感檔案加密。使用前需設定倉庫和加密配置;這裡只描述能力,不代表資料已經備份或恢復。備份儲存庫內容會上傳至 GitHub;推送前核對目標儲存庫和 git-crypt 設定,切勿以明文包含秘密。

資料釋出於 2026-10-27

可以用來做什麼

  • 規劃工作區備份流程
  • 整理加密備份與恢復步驟

什麼時候用

  • 需要為 Clawdbot 工作區制定備份方案時
  • 需要了解加密備份的設定和恢復流程時

示例提示詞

以下是根據技能文件生成的示例,不代表實際執行結果。

說明如何備份這個工作區並加密敏感檔案
列出執行恢復前需要檢查的事項

月度資料趨勢

累計下載4630
3046389747472026-03 · 累計下載 31632026-05 · 累計下載 38252026-06 · 累計下載 39722026-07 · 累計下載 42292026-08 · 累計下載 43982026-09 · 累計下載 463026-0326-09
星標2
1232026-03 · 星標 22026-05 · 星標 22026-06 · 星標 22026-07 · 星標 22026-08 · 星標 22026-09 · 星標 226-0326-09

2026-09 起統計方法調整:同名技能按作者分別統計,並覆蓋全部技能。圖中虛線為調整前的月份,與之後的資料不直接比較,也不計算跨越調整的增長。

月份累計下載環比星標
2026-094630—2
2026-084398+4.0%2
2026-074229+6.5%2
2026-063972+3.8%2
2026-053825—2
2026-033163—2

SKILL.md 原文

以下是作者釋出的原始檔案,按純文字顯示,本站未做修改或稽核;其中的連結不可點選,命令請核實後再執行。抓取於 2026-10-23。

2.8 KB · ClawHub v1.0.0
---
name: git-crypt-backup
description: Backup Clawdbot workspace and config to GitHub with git-crypt encryption. Use for daily automated backups or manual backup/restore operations.
---

# Git-Crypt Backup

Automated backup of Clawdbot workspace (`~/clawd`) and config (`~/.clawdbot`) to GitHub with sensitive files encrypted via git-crypt.

## Setup
展開全部(共 121 行)

### 1. Create GitHub repos (private recommended)

```bash
# Create two private repos on GitHub:
# - <username>/clawdbot-workspace
# - <username>/clawdbot-config
```

### 2. Initialize git-crypt

```bash
# Install git-crypt
brew install git-crypt  # macOS
# apt install git-crypt  # Linux

# Workspace repo
cd ~/clawd
git init
git-crypt init
git remote add origin [email protected]:<username>/clawdbot-workspace.git

# Config repo
cd ~/.clawdbot
git init
git-crypt init
git remote add origin [email protected]:<username>/clawdbot-config.git
```

### 3. Configure encryption

**Workspace `.gitattributes`:**
```
SOUL.md filter=git-crypt diff=git-crypt
USER.md filter=git-crypt diff=git-crypt
HEARTBEAT.md filter=git-crypt diff=git-crypt
MEMORY.md filter=git-crypt diff=git-crypt
memory/** filter=git-crypt diff=git-crypt
```

**Config `.gitattributes`:**
```
clawdbot.json filter=git-crypt diff=git-crypt
.env filter=git-crypt diff=git-crypt
credentials/** filter=git-crypt diff=git-crypt
telegram/** filter=git-crypt diff=git-crypt
identity/** filter=git-crypt diff=git-crypt
agents/**/sessions/** filter=git-crypt diff=git-crypt
nodes/** filter=git-crypt diff=git-crypt
```

**Config `.gitignore`:**
```
*.bak
*.bak.*
.DS_Store
logs/
media/
browser/
subagents/
memory/
update-check.json
*.lock
```

### 4. Export keys (important!)

```bash
mkdir -p ~/clawdbot-keys
cd ~/clawd && git-crypt export-key ~/clawdbot-keys/workspace.key
cd ~/.clawdbot && git-crypt export-key ~/clawdbot-keys/config.key
```

⚠️ **Store these keys securely** (1Password, iCloud Keychain, USB drive, etc.)

### 5. Initial commit & push

```bash
cd ~/clawd && git add -A && git commit -m "Initial backup" && git push -u origin main
cd ~/.clawdbot && git add -A && git commit -m "Initial backup" && git push -u origin main
```

## Daily Backup

Run `scripts/backup.sh`:

```bash
~/clawd/skills/git-crypt-backup/scripts/backup.sh
```

Or set up a cron job for automatic daily backups.

## Restore on New Machine

```bash
# 1. Clone repos
git clone [email protected]:<username>/clawdbot-workspace.git ~/clawd
git clone [email protected]:<username>/clawdbot-config.git ~/.clawdbot

# 2. Unlock with keys
cd ~/clawd && git-crypt unlock /path/to/workspace.key
cd ~/.clawdbot && git-crypt unlock /path/to/config.key
```

## What Gets Encrypted

| Repo | Encrypted | Plain |
|------|-----------|-------|
| workspace | SOUL/USER/HEARTBEAT/MEMORY.md, memory/** | AGENTS.md, IDENTITY.md, TOOLS.md, drafts/** |
| config | clawdbot.json, .env, credentials/**, sessions/** | cron/jobs.json, settings/** |

「運維安全」分類下的熱門技能

資料月份:2026-09 · 下載/星標/安裝數聚合自公開技能註冊庫(ClawHub、SkillHub),按月更新。口徑說明見資料方法。