- Home
- Skills
- APIs & Backend
- Backup and Restore Proof for SQLite Services
Backup and Restore Proof for SQLite Services
WAL-safe encrypted backups that prove they restore before reporting success, with a hardened systemd timer, an isolated restore verifier and an offsite copier that ships ciphertext only. Node 22.5+, no packages.
$29
Works with the AI Agents you already use
Backup and Restore Proof for SQLite Services
Example session with this skill installed
Set up nightly encrypted backups for our service's SQLite database and its blobs directory (table documents, files named <id>.enc), prove the first backup restores, and schedule it with systemd.
- Read your context and instructions
- Compiled the backup and restore
Summary
First archive written, decrypted, integrity-checked and inventoried before success was reported. The timer is enabled; the key is in /etc/app-backup/backup-key and must be copied offline now.
| Check | Result |
|---|---|
| Unit tests on this host | 10 pass, 0 fail |
| Snapshot | backup() API, integrity_check ok (WAL rows included) |
| Rows / live / blobs copied | 1,291 / 1,284 / 1,284 (7 soft-deleted rows, no alarm) |
| Missing blobs | none |
| Restore test | passed: 1,284 blobs back, integrity_check ok |
| Archive | app-20260504T034012Z.tar.gz.enc (412 MB, AES-256-GCM, mode 0600) |
| Receipt | app-20260504T034012Z.tar.gz.enc.json |
| Retention | 14 archives, floor 1 |
| Timer | app-backup.timer 03:40 UTC, randomized 10 min, persistent |
{"ok":true,"command":"create","format":"EBKP1","fileRows":1291,"liveFiles":1284,"restoredBlobs":1284,"missingInArchive":[],"integrityCheck":"ok","restoreTest":"passed","blobsCopied":1284,"missingBlobs":[],"retained":1}
Unit hardening: ProtectSystem=strict, ProtectHome=yes, PrivateTmp=yes, PrivateNetwork=yes, NoNewPrivileges=yes, ReadWritePaths=/var/backups/app, ReadOnlyPaths=/var/lib/app /var/lib/app/blobs, key via LoadCredential=backup-key.
Next steps
- Copy
/etc/app-backup/backup-keyto the offline password manager and record where; without it every archive is unreadable. - Configure rclone
hot,coldand read-onlyverifyremotes, then add a second timer runningoffsite-copy.shafter 04:00. - Run the monthly drill with
verify-restore.shfrom an offsite copy and keep the receipt.
Connects securely to your tools. The creator never sees your data.
About this skill
A cp of a live SQLite database in WAL mode is a torn read that still opens, and a backup nobody has restored is a hope. This skill does the backup properly and proves each archive restores before it reports success.
Scripts (Node 22.5+, no packages)
backup.mjs: online snapshot throughnode:sqlitebackup(),integrity_check, blobs of live rows only (soft-deleted rows never raise a false alarm; a live row with no blob on disk fails the run but keeps the archive as the best copy of what remains), streamed tar through AES-256-GCM with the key read from a file or systemdLoadCredential(never an env var), every archive decrypted and inventoried before success, a JSON receipt per archive, retention that never prunes the last archive, half-written archives deleted on failure.backup-cli.mjs:create,verify <archive>,restore <archive> <empty-dir>; one JSON line, non-zero on failure so a broken backup is a failed unit.backup.test.mjs: 10 tests (WAL capture, soft delete, vanished blob, no plaintext in the archive, wrong key, tampering, non-empty restore refusal, retention floor, no half-written archive).install-backup-timer.sh: runs the tests first, generates a key only if none exists (regenerating would orphan every archive), hardened oneshot unit (ProtectSystem=strict,PrivateNetwork, read-only data paths), timer, first run.verify-restore.sh: isolated restore drill: sidecar hash required, refuses workspaces under live paths, refuses tars with absolute paths,.., links or special files,quick_checkon every database, hashed manifest, receipt JSON.offsite-copy.sh: rclone hot (daily) and cold (monthly) tiers; uploads only*.tar.gz.encand.sha256sidecars; refuses archives whose receipt lacks a passed restore test; verifies through a separate read-only remote; hot retention.
References
Design notes (archive format, key handling, the two kinds of missing blob, why the restore test is mandatory) and a monthly restore drill with a record template.
Requirements
Tested on Linux and Windows. Network: none, except the rclone remotes you configure for offsite.
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for APIs & Backend.
One SQLite database per archive. Blob inventory assumes one table and id-based filenames. Installer requires systemd. Not legal advice.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 19 days ago
- Software
Node.js 22.5+tarsystemd (timer installer, Linux only)rclone (offsite copies only)
Permissions
Shell runs node, tar, sha256sum, systemctl (installer) and rclone (offsite). Read files: the live SQLite database, blob directory and the key file you configure. Write files: the archive directory, receipts, systemd unit files (installer) and the scratch restore directory. Network: only offsite-copy.sh, to the rclone remotes you name. The key is read from a file or LoadCredential, never an environment variable.