fairdb-backup-manager
jeremylongshore/claude-code-plugins-plus
當您需要處理備份與復原作業時,請使用此技能。此技能提供備份自動化與災難復原功能,並附有詳盡的指引與自動化流程。可透過「建立備份」、「自動化備份」或「執行災難復原」等語句觸發此技能。
...展開全部關於fairdb-backup-manager
fairdb-backup-manager 技能可為使用 fairdb 資料庫的系統,自動化並優化備份與災難復原流程。它提供了一套全面的解決方案,用於管理備份、自動化定期備份排程,並確保在發生故障或災難時能順利恢復資料。 此技能專為協助系統管理員與開發人員而設計,旨在確保備份任務得以高效處理,從而減少人工操作,並將系統中斷或突發事件期間的資料遺失風險降至最低。
常見問題
如何使用「fairdb-backup-manager 」技能?
要使用「fairdb-backup-manager 」技能,請透過「建立備份」、「自動化備份」或「執行災難復原」等指令觸發。開始前請確保您已具備必要的權限並完成相關設定。
fairdb-backup-manager 支援哪些工具?
fairdb-backup-manager 技能支援以下工具:Read、Write、Edit、Grep、Glob、Bash(支援 tar、rsync 及 AWS S3)。這些工具可協助您有效管理備份任務與資料復原流程。
使用此技能是否有任何先決條件?
是的,您需要具備執行相關操作所需的憑證與權限。此外,了解系統架構、能查閱相關文件,以及擁有用於測試的預備環境,都是不可或缺的先決條件。
此技能可在生產環境中使用嗎?
是的,此技能可在生產環境中使用,但建議先在非生產環境中進行測試。部署前應進行徹底的測試、監控與驗證。
若發生權限或存取問題該如何處理?
若發生權限問題,請確認憑證正確無誤且具備必要的存取權限。如有需要,請申請提升權限,並針對自動化任務實施「最小權限原則」。
FairDB Backup Manager
Overview
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
tarandrsyncinstalled for file-level backups- AWS CLI configured with
s3:PutObjectands3:GetObjectpermissions (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 |
Restore failed: checksum mismatch | Backup file corrupted during transfer or storage | Re-download from S3; verify S3 object integrity; use a different backup copy |
Database inconsistent after restore | Backup taken during active write without lock | Ensure backup script acquires a consistent snapshot lock before export |
Examples
- "Create an automated nightly backup for the FairDB production instance, compressed and uploaded to S3 with KMS encryption and 30-day retention."
- "Generate a restore runbook that pulls the latest backup from S3, verifies integrity, and restores to a staging instance for validation."
- "Set up backup monitoring that alerts via Slack if a backup job fails or if no successful backup exists within the last 25 hours."
Resources
- AWS S3 CLI: https://docs.aws.amazon.com/cli/latest/reference/s3/
- rsync documentation: https://rsync.samba.org/documentation.html
- Backup automation patterns: https://www.veeam.com/blog/321-backup-rule.html
- Linux cron scheduling: https://crontab.guru/
安裝 fairdb-backup-manager
請下載並將技能檔案解壓縮至您的 .claude/skills/ 目錄中。
下載 ZIP複製儲存庫並將技能檔案複製到您的專案中。
git clone https://github.com/jeremylongshore/claude-code-plugins-plus-skills/blob/main/plugins/devops/fairdb-operations-kit/skills/fairdb-backup-manager/SKILL.md # Copy SKILL.md to your .claude/skills/ directory
複製





首頁
