Skip to content

jeremylongshore/tons-of-skills-marketplace / plugins/database/database-backup-automator/skills/automating-database-backups

automating-database-backups

Flagged

Automate database backup processes with scheduling, compression, and encryption. Supports PostgreSQL (pg_dump), MySQL (mysqldump), MongoDB (mongodump), and SQLite. Generates production-ready backup scripts with retention policies and restore procedures. Trigger: "automate database backups", "schedule backups", "create backup script", "disaster recovery". Use when working with automating database backups. Trigger with 'automating', 'database', 'backups'.

scripts/backup-monitoring.sh

View on GitHub
#!/usr/bin/env bash
set -euo pipefail

usage() {
  echo "Usage: $(basename "$0") <backup-dir> [max_age_minutes]" >&2
}

if [[ "${1:-}" == "-h" || "${1:-}" == "--help" ]]; then
  usage
  exit 0
fi

backup_dir="${1:-}"
max_age_minutes="${2:-1440}"

if [[ -z "$backup_dir" ]]; then
  usage
  exit 2
fi

if [[ ! -d "$backup_dir" ]]; then
  echo "ERROR: backup dir not found: $backup_dir" >&2
  exit 2
fi

latest="$(find "$backup_dir" -type f -maxdepth 1 -print0 | xargs -0 ls -1t 2>/dev/null | head -n 1 || true)"
if [[ -z "$latest" ]]; then
  echo "ERROR: no backup files found in: $backup_dir" >&2
  exit 1
fi

age_minutes=$(( ( $(date +%s) - $(stat -c %Y "$latest") ) / 60 ))
echo "Latest backup: $latest"
echo "Age (minutes): $age_minutes"

if (( age_minutes > max_age_minutes )); then
  echo "ERROR: latest backup is older than max_age_minutes=$max_age_minutes" >&2
  exit 1
fi

echo "OK: backup freshness within threshold."

deprecation-and-migrationaddyosmani/agent-skillsManages deprecation and migration. Use when removing old systems, APIs, or features. Use when migrating users from one implementation to another. Use when migrating a database schema in production, such as renaming or dropping a column without downtime (expand/contract). Use when deciding whether to maintain or sunset existing code.Stars: 119kUpdated Claude CodeCodexVerifiedInstall
performance-optimizationaddyosmani/agent-skillsOptimizes application performance across frontend, backend, queries, and databases. Use when performance requirements exist, when you suspect performance regressions, when Core Web Vitals or load times need improvement, when N+1 query patterns need fixing, or when profiling reveals bottlenecks.Stars: 119kUpdated Claude CodeCodexVerifiedInstall
agent-cost-reportthedotmack/claude-memBelievable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude Code transcripts priced at OpenRouter list prices (ESTIMATED), measured provider spend when a sanctioned source exists, note-taker cost separate, Timing-style HTML/PDF plus report.json, line-items.csv, evidence.json.Stars: 118kUpdated Claude CodeCodexVerifiedInstall
agent-cost-reportthedotmack/claude-memBelievable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude Code transcripts priced at OpenRouter list prices (ESTIMATED), measured provider spend when a sanctioned source exists, note-taker cost separate, Timing-style HTML/PDF plus report.json, line-items.csv, evidence.json.Stars: 118kUpdated Claude CodeCodexVerifiedInstall