🗄️ SLV Backup
SLV Backup 使用
restic 为您的节点创建
加密的增量备份。所有数据在上传前都在客户端使用 AES-256 加密——服务器永远不会看到您的明文数据。
传统模式:SLV 也支持未加密的 tar+zstd 备份(不使用 --restic)。我们强烈建议对所有新备份使用 --restic。
前提条件
- 目标节点上已安装 SLV CLI
sudo 访问权限(全盘备份需要)
- 已登录(
slv login)且有活跃的存储订阅
- 已安装
restic(apt install restic)
创建加密备份
sudo slv backup create --restic --yes
sudo slv backup create --restic --yes
🗄️ SLV Backup (restic mode)
Region: default
Retention: 7 days
⚠️ Restic encryption password generated and saved to:
/home/solv/.slv/restic-password
BACK UP THIS FILE — without it, backups cannot be restored.
🔧 Initializing restic repository (if needed)...
📦 Creating restic backup...
Files: 151263 new, 0 changed, 0 unmodified
Dirs: 22486 new, 0 changed, 0 unmodified
Added to the repository: 4.107 GiB (1.837 GiB stored)
processed 151263 files, 4.366 GiB in 0:50
snapshot b6925e6d saved
✅ Restic backup complete
🧹 Applying retention policy (keep within 7 days)...
✅ Backup complete.
🗄️ SLV Backup (restic mode)
Region: default
Retention: 7 days
⚠️ Restic encryption password generated and saved to:
/home/solv/.slv/restic-password
BACK UP THIS FILE — without it, backups cannot be restored.
🔧 Initializing restic repository (if needed)...
📦 Creating restic backup...
Files: 151263 new, 0 changed, 0 unmodified
Dirs: 22486 new, 0 changed, 0 unmodified
Added to the repository: 4.107 GiB (1.837 GiB stored)
processed 151263 files, 4.366 GiB in 0:50
snapshot b6925e6d saved
✅ Restic backup complete
🧹 Applying retention policy (keep within 7 days)...
✅ Backup complete.
首次运行时的操作
- 生成一个随机加密密码并保存到
~/.slv/restic-password(权限 0600)
- 在 ERPC Cloud Storage 上初始化一个 restic 仓库
- 备份整个磁盘(排除系统伪文件系统)
后续运行
仅上传已更改的文件(增量)。去重功能可降低存储成本。
列出备份
显示云存储中的 restic 快照和传统 tar 备份。
从备份恢复
恢复最新快照:
sudo slv backup restore latest
sudo slv backup restore latest
恢复特定快照:
sudo slv backup restore b6925e6d
sudo slv backup restore b6925e6d
恢复传统 tar 备份:
sudo slv backup restore backup-mynode-20260318.tar.zst
sudo slv backup restore backup-mynode-20260318.tar.zst
验证备份完整性
要自行运行 restic check,请使用存储访问密钥连接。此端点不接受 RPC API 密钥。
- 打开 Storage 页面,进入 存储访问密钥,然后点击 签发密钥。
check 只需 只读 权限即可。
- 复制密钥创建后立即显示的 restic 仓库 URL。它只显示一次:如果丢失,请吊销该密钥并签发新密钥。
- 使用该 URL 运行
check:
sudo restic -r '<RESTIC_REPOSITORY_URL>' \
--password-file ~/.slv/restic-password check
sudo restic -r '<RESTIC_REPOSITORY_URL>' \
--password-file ~/.slv/restic-password check
设置自动备份(Cron)
sudo slv backup create --restic --cron daily
sudo slv backup create --restic --cron daily
保留策略
默认情况下,超过 7 天的快照会自动清理:
sudo slv backup create --restic --retention 14
sudo slv backup create --restic --retention 14
自定义排除项
查看当前排除列表:
slv backup create --list-excludes
slv backup create --list-excludes
添加额外的排除路径:
sudo slv backup create --restic --exclude /home/solv/ledger --exclude /home/solv/snapshots
sudo slv backup create --restic --exclude /home/solv/ledger --exclude /home/solv/snapshots
加密与安全
⚠️ 重要提示:请单独备份您的 ~/.slv/restic-password 文件。没有此文件,您的备份将无法恢复。
选项参考
传统模式(tar+zstd)
为了向后兼容,仍支持未加密的 tar 备份:
sudo slv backup create --upload --yes # Unencrypted tar backup
sudo slv backup create --upload --yes # Unencrypted tar backup
注意:传统备份未加密。我们建议所有新备份迁移到 --restic。