filiptrivan/spiderly/backups
Claude Code and agent skill by filiptrivan/spiderly
- community
Checking that the SKILL.md file is still in the repository.
Back up and restore a Spiderly app's Postgres database, and archive logs off the VPS. Use when setting up automated database backups, scheduling pg_dump to object storage (Cloudflare R2), restoring from a backup, running a restore drill, configuring backup retention, or archiving Serilog file logs. Covers the backup and restore scripts, cron scheduling, and the R2 bucket Terraform.
Install
npx vskill@latest install filiptrivan/spiderly/backupsSKILL.md
Backups
If you ship this stack to prod, you ship a backup with it. Postgres data lives in a Docker volume on a single VPS — disk failure, accidental docker volume rm, or terraform destroy all wipe it without a snapshot to restore from.
Database backups (required)
Daily pg_dump to a Cloudflare R2 bucket, 7-day retention both local and remote. ~24h RPO; if you need tighter, layer WAL archiving on top (separate skill).
1. R2 bucket — Terraform-managed. No chicken-and-egg here (only the state bucket has to be bootstrapped manually); manage data buckets like any other resource:
2. Backup script — `infrastructure/scripts/pg_backup_s3.sh` (deployed to /usr/local/bin/ on the VPS). Note the trap cleanup, the aws s3api list-objects-v2 --query for retention (structured + locale-safe vs parsing aws s3 ls with awk), and the per-iteration warn-on-failure inside the while subshell (where set -e does NOT propagate):
3. VPS prerequisites. Add awscli and cron to cloud-init packages: so future server replacements have them. Configure R2 credentials in /root/.aws/credentials (same keys as the Terraform state backend — they're account-scoped):
4. Cron entry (/etc/cron.d/<your-app>-pg-backup). Wrap with flock -n so a hung run doesn't get a second instance started 24h later:
5. Restore — `scripts/db-restore.sh` (run from local). Lists server-side backups via SSH, prompts for selection, takes a safety dump first (with size check — refuses to proceed if pg_dump silently produced an empty file), then restores. Note set -euo pipefail inside the SSH heredocs (without it, a pg_dump failure inside a pipeline is masked by a successful gzip) and the OVERWRITE <db> confirmation phrase (a bare DB name is too easy to typo into):
6. Restore drill — quarterly. A backup you've never restored from is not a backup. At least once a quarter, restore the latest dump into a throwaway local Postgres and verify schema + row counts. Calendar reminder.
Log archival (optional)
When to use it: you need long-term log retention beyond Docker's json-file rotation buffer (default ~150 MB rolling per container, configured in compose).
Pattern: a Hangfire recurring job watches /app/logs/, ships files older than N days to R2 once total > threshold, deletes locally.
To make /app/logs writable under USER app:
- Bind mount with chowned host dir (recommended):
volumes: - /var/log/<your-app>:/app/logsin compose, one-timemkdir -p /var/log/<your-app> && chown 1654:1654 /var/log/<your-app>on the VPS. Bind mounts respect host ownership; named volumes overlay the path with root-owned storage whichappcan't write to. - No File sink at all (simpler): rely on Console + Docker rotation. Drop the
/app/logsvolume entirely. Right answer for greenfield deploys.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingclaude-plugins/skills/backups/SKILL.md
Popularity
- Repository stars
- 61
- Repository forks
- 24
- 7-day trend score
- 21
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/filiptrivan/spiderly/backups)