🗄️ 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。