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
累计下载
4,630
星标
2
全站排名
#2,059
全站前 41% · 「运维安全」前 41%
平台累计安装累计下载星标评论
ClawHub ↗1534,5532-
SkillHub ↗2144,6302—

各平台的计数口径不同,统计时间不一致。

这个技能是做什么的

该技能说明自动或手动备份与恢复流程,目标是把工作区和配置保存在 GitHub 仓库中,并对敏感文件加密。使用前需设置仓库和加密配置;这里只描述能力,不代表数据已经备份或恢复。备份仓库内容会上传到 GitHub;推送前核对目标仓库和 git-crypt 配置,切勿以明文包含秘密。

资料发布于 2026-10-27

可以用来做什么

  • 规划工作区备份流程
  • 整理加密备份与恢复步骤

什么时候用

  • 需要为 Clawdbot 工作区制定备份方案时
  • 需要了解加密备份的设置和恢复流程时

示例提示词

以下是根据技能文档生成的示例,不代表实际运行结果。

说明如何备份这个工作区并加密敏感文件
列出执行恢复前需要检查的事项

月度数据趋势

累计下载4,630
3,0463,8974,7472026-03 · 累计下载 3,1632026-05 · 累计下载 3,8252026-06 · 累计下载 3,9722026-07 · 累计下载 4,2292026-08 · 累计下载 4,3982026-09 · 累计下载 4,63026-0326-09
星标2
1232026-03 · 星标 22026-05 · 星标 22026-06 · 星标 22026-07 · 星标 22026-08 · 星标 22026-09 · 星标 226-0326-09

2026-09 起统计方法调整:同名技能按作者分别统计,并覆盖全部技能。图中虚线为调整前的月份,与之后的数据不直接比较,也不计算跨越调整的增长。

月份累计下载环比星标
2026-094,630—2
2026-084,398+4.0%2
2026-074,229+6.5%2
2026-063,972+3.8%2
2026-053,825—2
2026-033,163—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),按月更新。口径说明见数据方法。