docker-db-backup

docker-db-backup is a skill for Claude Code from Dannykkh/skill-olympus. It costs 36 tokens per session (3,111 once invoked), scanned B, original, MIT.

A Docker Compose add-on that runs scheduled backups for PostgreSQL, MySQL, or MariaDB databases. It adds a backup container and the scripts and settings needed to run it.

In plain words
What is it for?
Use it to add a database-backup service to an existing Docker Compose project and configure its database type, backup location, schedule, and retention period.
Why use it?
It removes the need to arrange a separate scheduled backup process for a database running in Docker. The backup schedule and retention period can be configured through environment variables.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the skill-olympus plugin — 98 skills, 7 commands, 42 agents, 5 MCP servers shipped together

Good fit Use it to add a database-backup service to an existing Docker Compose project and configure its database type, backup location, schedule, and retention period.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/dannykkh/skill-olympus/docker-db-backup
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add Dannykkh/skill-olympus --skill docker-db-backup
Clone the repo
git clone --depth 1 https://github.com/Dannykkh/skill-olympus

Made for: Claude Code.

Or install skill-olympus, the plugin that ships this one along with the rest of its 98 skills, 7 commands, 42 agents, 5 MCP servers.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for docker-db-backup

README.md
[![agentmods](https://agentmods.dev/badge/skills/dannykkh/skill-olympus/docker-db-backup/github.svg)](https://agentmods.dev/skills/dannykkh/skill-olympus/docker-db-backup)
Your own site
<a href="https://agentmods.dev/skills/dannykkh/skill-olympus/docker-db-backup"><img src="https://agentmods.dev/badge/skills/dannykkh/skill-olympus/docker-db-backup/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for docker-db-backup

Your own site · 80×15
<a href="https://agentmods.dev/skills/dannykkh/skill-olympus/docker-db-backup"><img src="https://agentmods.dev/badge/skills/dannykkh/skill-olympus/docker-db-backup.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 36 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,111 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00036 $0.03111
Opus 5 $0.00018 $0.01555
Sonnet 5 $0.00007 $0.00622
Haiku 4.5 $0.00004 $0.00311

Measured 6d ago against content hash 6d5c6c485b84, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade B, and why

docker-db-backup scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

chmod 0644 /etc/cron.d/db-backup
skills/docker-db-backup/SKILL.md · 310 lines

How it starts

The opening of the file, as written. The whole thing — 310 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Docker DB Backup Skill

Docker Compose 프로젝트에 cron 기반 자동 DB 백업 컨테이너를 추가하는 스킬입니다.

Skill Description

Triggers:

  • /docker-db-backup — 대화형으로 DB 종류를 확인 후 백업 서비스 추가
  • /docker-db-backup pg — PostgreSQL 백업 서비스 추가
  • /docker-db-backup mysql — MySQL/MariaDB 백업 서비스 추가

생성/수정되는 파일:

  • {compose-dir}/backup-entrypoint.sh — 백업 실행 엔트리포인트
  • {compose-dir}/docker-compose.yml — db-backup 서비스 추가
  • {compose-dir}/.env — 백업 설정 변수 추가

Execution Steps

Step 1: 프로젝트 분석

  1. docker-compose.yml 위치를 찾는다 (프로젝트 루트 또는 docker-images/ 등)
  2. 기존 DB 서비스를 파악한다:
    • postgres / pg 이미지 → PostgreSQL
    • mysql / mariadb 이미지 → MySQL/MariaDB
  3. DB 서비스명, 환경변수명, 포트, 헬스체크 조건을 추출한다
  4. 인자가 없으면 사용자에게 DB 종류를 확인한다

Step 2: backup-entrypoint.sh 생성

반드시 LF 줄바꿈으로 생성해야 한다. Windows에서 CRLF로 생성하면 컨테이너에서 깨진다.

생성 후 아래 명령을 실행:

sed -i 's/\r$//' {compose-dir}/backup-entrypoint.sh
PostgreSQL 템플릿
#!/bin/sh
set -e

BACKUP_DIR="${BACKUP_DIR:-/backups}"
RETENTION_DAYS="${RETENTION_DAYS:-7}"
CRON_SCHEDULE="${CRON_SCHEDULE:-0 2 * * *}"

mkdir -p "$BACKUP_DIR"

cat > /usr/local/bin/run-backup.sh << 'SCRIPT'
#!/bin/sh
set -e

BACKUP_DIR="${BACKUP_DIR:-/backups}"
RETENTION_DAYS="${RETENTION_DAYS:-7}"
TIMESTAMP=$(date +%Y%m%d_%H%M%S)
BACKUP_FILE="${BACKUP_DIR}/${POSTGRES_DB}_${TIMESTAMP}.sql.gz"

echo "[$(date '+%Y-%m-%d %H:%M:%S')] 백업 시작: ${POSTGRES_DB}"

PGPASSWORD="$POSTGRES_PASSWORD" pg_dump \
    -h "$POSTGRES_HOST" \
    -p "${POSTGRES_PORT:-5432}" \
    -U "$POSTGRES_USER" \
    "$POSTGRES_DB" \
    --no-owner --no-acl \
    | gzip > "$BACKUP_FILE"

SIZE=$(du -h "$BACKUP_FILE" | cut -f1)
echo "[$(date '+%Y-%m-%d %H:%M:%S')] 백업 완료: $BACKUP_FILE ($SIZE)"

DELETED=$(find "$BACKUP_DIR" -name "${POSTGRES_DB}_*.sql.gz" -mtime +"$RETENTION_DAYS" -print -delete | wc -l)
if [ "$DELETED" -gt 0 ]; then
    echo "[$(date '+%Y-%m-%d %H:%M:%S')] 오래된 백업 ${DELETED}개 삭제 (보관: ${RETENTION_DAYS}일)"
fi

echo "[$(date '+%Y-%m-%d %H:%M:%S')] 현재 백업 목록:"
ls -lh "$BACKUP_DIR"/${POSTGRES_DB}_*.sql.gz 2>/dev/null || echo "  (없음)"
SCRIPT

chmod +x /usr/local/bin/run-backup.sh
env | grep -E '^(POSTGRES_|BACKUP_|RETENTION_)' > /etc/backup.env
echo "${CRON_SCHEDULE} . /etc/backup.env; /usr/local/bin/run-backup.sh >> /var/log/backup.log 2>&1" > /etc/crontabs/root

echo "============================================"
echo "  DB Backup Service Started (PostgreSQL)"
echo "  Schedule: ${CRON_SCHEDULE}"
echo "  Retention: ${RETENTION_DAYS} days"
echo "  Backup dir: ${BACKUP_DIR}"
echo "============================================"

echo "[$(date '+%Y-%m-%d %H:%M:%S')] 초기 백업 실행..."
/usr/local/bin/run-backup.sh

exec crond -f -l 2

Read the full file on GitHub · 310 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 310 lines · 36 tokens per session scan B 6d5c6c485b84

Subscribe to this mod's changes

docker-db-backup is a skill published in the GitHub repository Dannykkh/skill-olympus (5 stars, last pushed yesterday), licensed MIT. It adds 36 tokens to every session and 3,111 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it B with 1 finding (asks for root). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

deploy-check

Deployment readiness check for Docker/Traefik projects. Use when: "deploy check", "deployment check", "ready for deployment", "deploy-check", "before deploy", "production ready".

claude-hangar/claude-hangar · 42 tokens

factory-db-migration

The operational discipline for running a destructive change against a production database — schema migrations, data backfills, one-shot RPCs, historical seed imports. Adjacent to factory-data-layer.md (schema design) and factory-deployment.md (where migrations execute in CI) — this skill is about the runbook around…

nonlinear-xyz/factory-kit · 155 tokens

factory-api

API conventions for both server actions and tRPC builds. Covers the decision between them, per-mutation Zod input schemas, central router composition, pagination shape, multi-field search via Drizzle ilike + or(), mutation lifecycle hooks, conditional query enabling, stale-time defaults, error response shape and…

nonlinear-xyz/factory-kit · 95 tokens

factory-data-layer

Database schema, ORM, and migration conventions across builds. Drizzle as default with domain-partitioned schema modules, shared timestamps helper, multi-tenancy keys with cascade delete, pgTableCreator prefixing, JSONB for flexible attributes, schema-derived type exports, polymorphic table patterns, ESLint Drizzle…

nonlinear-xyz/factory-kit · 84 tokens

factory-db-migration-engineer

Use when planning or executing a destructive change against a production database — schema migrations with backfills, periodic data imports, one-shot RPCs, drop-constraint operations, anything that mutates prod tables and cannot be trivially undone. Sister agent to db-schema-architect (schemas) and…

nonlinear-xyz/factory-kit · 156 tokens

factory-db-schema-architect

Use when designing or modifying database schemas, migrations, multi-tenant data models, or polymorphic table structures. Carries the factory's data-layer conventions — Drizzle with domain-partitioned schema modules, shared.ts with timestamps helper and pgTableCreator, org-keyed FKs with cascade delete, JSONB envelope…

nonlinear-xyz/factory-kit · 127 tokens