Failsafe Backups Engine β
ShellGuard's backup engine provides atomic, non-blocking instance snapshots using SQLite's native Online Backup API.
πΎ Snapshot Mechanics β
- API: Calls
db.backup(destPath)from the native driver. - Concurrency Safe: Takes snapshots cleanly during live traffic in SQLite WAL (Write-Ahead Logging) mode without table locks.
- Coupled Snapshots: Captures atomic copies of both
db.sqliteandaudit.sqlite. - Destination: Saved directly to
DATA_DIR/backups/with ISO timestamps:textdata/backups/ βββ db-2026-08-28T20-00-00Z.sqlite βββ audit-2026-08-28T20-00-00Z.sqlite βββ manifest.json
π The Backup Manifest (manifest.json) β
Every backup cycle updates manifest.json with cryptographic verification hashes:
json
{
"backups": [
{
"timestamp": "2026-08-28T20:00:00.000Z",
"version": "0.0.1",
"dbFile": "db-2026-08-28T20-00-00Z.sqlite",
"dbSha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"dbSizeBytes": 135168,
"auditFile": "audit-2026-08-28T20-00-00Z.sqlite",
"auditSha256": "4b227777d4dd1fc61c6f884f48641d02b4d121d3fd328cb08b5531fcacdabf8a",
"auditSizeBytes": 32768,
"encrypted": true
}
]
}π Retention & Pruning β
The scheduler automatically prunes older backups to keep the most recent N snapshots (configurable in the UI, default: 7).