# borgmatic 接入 Server酱：Borg 备份失败时微信收到告警（2026 教程）

> 通过 borgmatic 内置的 Apprise 钩子接入 Server酱，实现 Borg 备份成功或失败时微信推送通知，备份异常不再无人知晓。

- 网页版：https://sct.ftqq.com/docs/integrations/borgmatic/
- 更新日期：2026-07-17

# borgmatic + Server酱：Borg 备份失败时微信收到告警

> 效果：Borg 备份成功或失败时微信收到通知，备份悄悄挂掉不再无人知晓

## 前置条件

- 获取 Server酱 SendKey：登录 sct.ftqq.com，在「SendKey」页面复制（[30 秒获取教程](https://sct.ftqq.com/docs/getting-started/sendkey/)）
- borgmatic 已安装并配置好备份任务
- 安装 Apprise 依赖：`pip install apprise`
- 如需推送到企业微信/钉钉/飞书群，见[通道对比](https://sct.ftqq.com/docs/getting-started/channels/)

## 配置步骤

在 borgmatic 的 `config.yaml` 中添加 Apprise 监控钩子配置：

```yaml
apprise:
    services:
        - url: schan://你的SENDKEY
          label: serverchan
```

`schan://` 是 Apprise 中 Server酱 的专用协议。注意：该协议仅支持 `SCT` 开头的 SendKey。

保存配置后，先通过命令行验证连通性：

```bash
apprise -t "测试" -b "正文" "schan://你的SENDKEY"
```

若微信收到测试消息，说明配置无误。后续 borgmatic 执行备份时，会自动通过此钩子推送结果。关于 states 等更细粒度的推送条件配置，以 borgmatic 官方文档为准。

## 完整示例

一段包含 Apprise 钩子的最小化 `config.yaml` 参考片段：

```yaml
# 在已有的 borgmatic 配置中添加以下 apprise 部分
apprise:
    services:
        - url: schan://你的SENDKEY
          label: serverchan
```

## 常见问题

**额度是多少？**
免费版每日可发送 5 条，每分钟上限 50 次。订阅会员目前特价最低 3 元/月，一天最多可发 1000 条（[价格详情](https://sct.ftqq.com/subscribe)）。

**消息没收到怎么办？**
先检查 SendKey 是否正确，再确认命令行 `apprise -vv` 测试是否通过。更多排查步骤见[常见问题与排查](https://sct.ftqq.com/docs/getting-started/faq/)。

**发送频率受限怎么办？**
免费版每分钟上限 50 次，若通知频率较高，如需更高额度，可订阅会员目前特价最低 3 元/月，一天最多可发 1000 条（[价格详情](https://sct.ftqq.com/subscribe)）。

**sctp 开头的 SendKey 能用吗？**
Apprise 的 `schan://` 协议目前仅支持 `SCT` 开头的 SendKey。如果是 `sctp` 开头的 SendKey，请参考 [/integrations/apprise/](https://sct.ftqq.com/docs/integrations/apprise/) 页面参考 [Apprise 通用接法](https://sct.ftqq.com/docs/integrations/apprise/) 了解其他接入方式。

## 相关集成

- [/integrations/python/](https://sct.ftqq.com/docs/integrations/python/) —— Python 脚本推送
- [/integrations/uptime-kuma/](https://sct.ftqq.com/docs/integrations/uptime-kuma/) —— Uptime Kuma 宕机告警
- [/integrations/qinglong/](https://sct.ftqq.com/docs/integrations/qinglong/) —— 青龙面板任务通知


## 懒人方案：把这段话复制给你的 AI 助手

把下面这段文字原样粘贴给 Claude Code、Cursor 或任何 AI 编程助手，它就会替你完成 Server酱 的接入：

```text
请帮我把 Server酱 微信通知接入到我当前的项目/工具中：
1. API：POST https://sctapi.ftqq.com/{SendKey}.send，参数 title（必填，不能含换行）、desp（正文，支持 Markdown，可选）；成功时返回 JSON 的 code 为 0。
2. 如果我的 SendKey 以 sctp 开头，则改用 https://{uid}.push.ft07.com/send/{SendKey}.send，uid 是 SendKey 中 sctp 与 t 之间的数字。
3. SendKey 从环境变量 SERVERCHAN_SENDKEY 读取；如果没有，提醒我到 https://sct.ftqq.com 免费获取（每天 5 条额度）。
4. 安全要求：不要把 SendKey 硬编码进代码、不要打印到日志、不要提交到 git。
5. 频率约定：任务结束发 1 条结果摘要即可，批量任务合并成一条，不要每步都推。
请根据我当前的项目和场景直接写好代码/配置并验证。
```

