Complete operations kit for FairDB PostgreSQL as a Service - VPS setup, PostgreSQL management, customer provisioning, monitoring, and backup automation
Use --global to install for all projects, or --project for current project only.
What It Does
FairDB is a managed PostgreSQL-as-a-Service platform built on Contabo VPS infrastructure with pgBackRest backups to Wasabi S3 storage. This plugin kit provides Claude with the ability to execute complex operational tasks through natural language commands.
Features
VPS Provisioning: Automated Contabo VPS setup with security hardening
PostgreSQL Management: Install, configure, and optimize PostgreSQL 16
Backup System: pgBackRest configuration with Wasabi S3 integration
Customer Provisioning: Automated database and user creation workflows
Monitoring: Health checks, performance monitoring, and alerting
Incident Response: Guided troubleshooting and recovery procedures
Intelligent Automation: AI-powered agent for proactive management
Automate backup and recovery operations for FairDB database instances. Generate backup scripts, configure retention policies, schedule automated backups to local storage or S3, and produce tested restore procedures with integrity verification.
Prerequisites
FairDB instance running and accessible with admin credentials
tar and rsync installed for file-level backups
AWS CLI configured with s3:PutObject and s3:GetObject permissions (if using S3 as backup target)
Sufficient storage at backup destination (2-3x database size for rotation)
Cron or systemd timer access for scheduling
Test environment available for restore verification
Instructions
Assess the FairDB instance: identify data directory location, database size, and write throughput
Select backup method: logical dump for portability, filesystem snapshot for speed, or continuous archiving for minimal RPO
Generate backup script with lock acquisition, data export, compression (tar czf), and checksum generation
Configure S3 upload with server-side encryption (aws s3 cp --sse aws:kms) for off-site copies
Set up retention policy: keep hourly backups for 24 hours, daily for 7 days, weekly for 4 weeks, monthly for 12 months
Create cleanup script to purge expired backups according to retention schedule
Schedule backups via cron with proper logging to /var/log/fairdb-backup.log
Generate restore procedure: download from S3, verify checksum, decompress, and import with validation query
Test restore procedure in a staging environment and document the time-to-recovery
Output
Backup shell script with logging, locking, compression, and S3 upload
Restore shell script with checksum verification and data validation
Cron schedule entries or systemd timer units
Retention cleanup script
S3 lifecycle policy configuration for long-term archive tiering
Error Handling
Error
Cause
Solution
Backup lock acquisition failed
Another backup or maintenance process is running
Check for stale lock files; implement timeout-based lock with flock
tar: Cannot open: No space left on device
Local backup destination full
Run retention cleanup; check disk usage with df -h; increase volume size
aws s3 cp: upload failed
Network issue or expired AWS credentials
Retry with --retry 3; refresh credentials; check S3 bucket permissions