Agent skill

Automating Database Backups

by jeremylongshore in jeremylongshore/tons-of-skills-marketplace

Automate database backup processes with scheduling, compression, and encryption.

MITAuto-check passedDatabases

Install Automating Database Backups

skills CLI
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill automating-database-backups -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install jeremylongshore/tons-of-skills-marketplace automating-database-backups --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/.curated/automating-database-backups .claude/skills/automating-database-backups && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
automating-database-backups
GitHub stars
2.8k
Token cost
~1.5k tokens
SKILL.md length
315 words
Files
16 (incl. scripts, references, assets)
Skills in repo
3,342
Repo updated
First seen
Licence
MIT

At a glance

Automate database backup processes with scheduling, compression, and encryption.

  • Works in 5 steps: Gather Requirements → Generate Backup Script → Schedule with Cron → …
  • Working with automating database backups
  • SKILL.md covers Quick Start, Instructions, Cron Schedule Reference and Retention Policy Example, plus 6 more sections
  • Runs Python and Shell scripts from its folder; calls python3 and pg_dump; needs MYSQL_PASSWORD

What it does

Automating Database Backups is an agent skill from jeremylongshore/tons-of-skills-marketplace. Automate database backup processes with scheduling, compression, and encryption. Supports PostgreSQL (pgdump), 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'.

Its SKILL.md is about 1.5k tokens, which your agent loads only when the skill is triggered. The skill folder holds 19 other files, including scripts, reference files and assets (for example `assets/README.md`, `config/settings.yaml` and `references/README.md`). Compatibility notes: Designed for Claude Code

It sits in Databases, covering Database administration, Backup and disaster recovery and NoSQL databases. It works with MySQL, PostgreSQL, MongoDB and SQLite. The repository describes itself as: Model-agnostic agent-skills platform with a harness-free canonical layer, verified adapters, and the ccpi package manager. Explore at tonsofskills.com. The licence is MIT.

When your agent uses it

  • Working with automating database backups
  • With automating

Example prompts

  • “automate database backups”
  • “schedule backups”
  • “create backup script”
  • “/automating-database-backups”

Requirements

  • Python 3
  • A Bash shell
  • Compatibility (from SKILL.md): Designed for Claude Code
  • Pre-approved tools (allowed-tools): Read, Write, Edit, Grep, Glob, Bash(pg_dump:*), Bash(mysqldump:*), Bash(mongodump:*), Bash(cron:*), Bash(gpg:*)

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Gather Requirements
  2. Generate Backup Script
  3. Schedule with Cron
  4. Validate Backup
  5. Generate Restore Procedure

What it can do on your machine

Read from SKILL.md and the folder at commit cfae287. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Write
    • Edit
    • Grep
    • Glob
    • Bash(pg_dump:*)
    • Bash(mysqldump:*)
    • Bash(mongodump:*)
    • Bash(cron:*)
    • Bash(gpg:*)

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 6 files in scripts/ (Python and Shell), which the agent can run.

    Shell commands in SKILL.md call:

    • python3
    • pg_dump

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • MYSQL_PASSWORD

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Designed for Claude Code

    From compatibility in the SKILL.md frontmatter.

Context cost

Automating Database Backups loads about 1.5k tokens when it runs, and up to ~11k if it reads all its reference files. Until then it costs about 121 tokens; SKILL.md has 315 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~121
When it runs · the whole SKILL.md, loaded when a task matches
~1.5k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~11k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from jeremylongshore/tons-of-skills-marketplace at commit cfae287, republished under its MIT licence (© jeremylongshore). 315 words, ~1,452 tokens.

Download SKILL.mdSave it as .claude/skills/automating-database-backups/SKILL.md (or your agent's skills folder). This skill also uses 15 other files; get the full folder from GitHub.
name
automating-database-backups
description
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'.
allowed-tools
Read, Write, Edit, Grep, Glob, Bash(pg_dump:*), Bash(mysqldump:*), Bash(mongodump:*), Bash(cron:*), Bash(gpg:*)
compatibility
Designed for Claude Code
version
1.26.0
author
Jeremy Longshore <jeremy@intentsolutions.io>
license
MIT
tags
database, postgresql, mysql, mongodb

Database Backup Automation

Generate production-ready backup scripts for PostgreSQL, MySQL, MongoDB, and SQLite with compression, encryption, scheduling, and retention policies.

Quick Start

PostgreSQL Backup
bash
#!/bin/bash
set -euo pipefail
BACKUP_DIR="/var/backups/postgresql"
DB_NAME="mydb"
DATE=$(date +%Y%m%d_%H%M%S)
BACKUP_FILE="${BACKUP_DIR}/${DB_NAME}_${DATE}.sql.gz"

pg_dump -h localhost -U postgres -d "$DB_NAME" \
  --format=custom \
  --compress=9 \
  --file="$BACKUP_FILE"

# Encrypt with GPG (optional)
gpg --symmetric --cipher-algo AES256 --batch --passphrase-file /etc/backup.key "$BACKUP_FILE"
rm "$BACKUP_FILE"
MySQL Backup
bash
#!/bin/bash
BACKUP_DIR="/var/backups/mysql"
DB_NAME="mydb"
DATE=$(date +%Y%m%d_%H%M%S)

mysqldump -h localhost -u root -p"${MYSQL_PASSWORD}" \
  --single-transaction \
  --routines \
  --triggers \
  "$DB_NAME" | gzip > "${BACKUP_DIR}/${DB_NAME}_${DATE}.sql.gz"
MongoDB Backup
bash
#!/bin/bash
mongodump --uri="mongodb://localhost:27017" \  # 27017: MongoDB port
  --db=mydb \
  --out=/var/backups/mongodb/$(date +%Y%m%d_%H%M%S) \
  --gzip

Instructions

Step 1: Gather Requirements

Ask the user for:

  • Database type (PostgreSQL, MySQL, MongoDB, SQLite)
  • Database connection details (host, port, database name)
  • Backup schedule (cron expression or frequency)
  • Retention policy (days to keep)
  • Encryption requirement (yes/no)
  • Backup destination (local path, S3, GCS)
Step 2: Generate Backup Script

Use scripts/backup_script_generator.py to create a customized backup script:

bash
python3 ${CLAUDE_SKILL_DIR}/scripts/backup_script_generator.py \
  --db-type postgresql \
  --database mydb \
  --output /opt/backup-scripts/mydb-backup.sh \
  --compression gzip \
  --encryption gpg
Step 3: Schedule with Cron

Use scripts/backup_scheduler.py to create cron entries:

bash
python3 ${CLAUDE_SKILL_DIR}/scripts/backup_scheduler.py \
  --script /opt/backup-scripts/mydb-backup.sh \
  --schedule "0 2 * * *" \
  --user postgres
Step 4: Validate Backup

After backup completes, validate integrity:

bash
python3 ${CLAUDE_SKILL_DIR}/scripts/backup_validator.py \
  --backup-file /var/backups/postgresql/mydb_20250115.sql.gz \
  --db-type postgresql
Step 5: Generate Restore Procedure

Create matching restore script:

bash
python3 ${CLAUDE_SKILL_DIR}/scripts/restore_script_generator.py \
  --db-type postgresql \
  --database mydb \
  --output /opt/backup-scripts/mydb-restore.sh

Cron Schedule Reference

ScheduleCron ExpressionDescription
Daily 2 AM0 2 * * *Low-traffic window
Every 6 hours0 */6 * * *Frequent backups
Weekly Sunday0 2 * * 0Weekly full backup
Monthly 1st0 2 1 * *Monthly archive

Retention Policy Example

bash
# Keep daily backups for 7 days
# Keep weekly backups for 4 weeks
# Keep monthly backups for 12 months

find /var/backups -name "*.gz" -mtime +7 -delete  # Daily cleanup
find /var/backups/weekly -mtime +28 -delete       # Weekly cleanup
find /var/backups/monthly -mtime +365 -delete     # 365: Monthly cleanup

Output

  • Backup Scripts: Database-specific shell scripts with compression and encryption
  • Cron Entries: Ready-to-install crontab configurations
  • Restore Scripts: Matching restore procedures for each backup type
  • Validation Reports: Integrity check results for backup files

Error Handling

ErrorCauseSolution
Connection refusedDB not runningCheck service status: systemctl status postgresql
Permission deniedWrong credentialsVerify user has backup privileges
Disk fullNo spaceCheck space: df -h, clean old backups
Lock timeoutActive transactionsUse --single-transaction for MySQL

Resources

  • ${CLAUDE_SKILL_DIR}/references/postgresql_backup_restore.md - PostgreSQL backup guide
  • ${CLAUDE_SKILL_DIR}/references/mysql_backup_restore.md - MySQL backup guide
  • ${CLAUDE_SKILL_DIR}/references/mongodb_backup_restore.md - MongoDB backup guide
  • ${CLAUDE_SKILL_DIR}/references/sqlite_backup_restore.md - SQLite backup guide
  • ${CLAUDE_SKILL_DIR}/references/backup_best_practices.md - Security and storage best practices
  • ${CLAUDE_SKILL_DIR}/references/cron_syntax.md - Cron scheduling reference

Overview

Automate database backup processes with scheduling, compression, and encryption.

Prerequisites

  • Access to the PostgreSQL environment or API
  • Required CLI tools installed and authenticated
  • Familiarity with PostgreSQL concepts and terminology

Examples

Basic usage: Apply automating database backups to a standard project setup with default configuration options.

Advanced scenario: Customize automating database backups for production environments with multiple constraints and team-specific requirements.

© jeremylongshore, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 15 other files (scripts, references, assets) in skills/.curated/automating-database-backups of jeremylongshore/tons-of-skills-marketplace.

  • SKILL.md
  • assets/README.md
  • config/settings.yaml
  • references/README.md
  • references/backup_best_practices.md
  • references/cron_syntax.md
  • references/mongodb_backup_restore.md
  • references/mysql_backup_restore.md
  • references/postgresql_backup_restore.md
  • references/sqlite_backup_restore.md
  • scripts/README.md
  • scripts/backup-monitoring.sh
  • scripts/backup_scheduler.py
  • scripts/backup_script_generator.py
  • scripts/backup_validator.py
  • scripts/restore_script_generator.py

Open the folder on GitHubat commit cfae287

Compare with similar skills

Automating Database Backups next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Automating Database Backups compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Automating Database Backups this skilljeremylongshore/tons-of-skills-marketplace2.8k—~1.5kAutomated safety check: PassMIT
Database Expertcin12211/orca-q224—~2.8kAutomated safety check: PassMIT
Prisma Database Setupcurvenote/curvenote1703 repos~1.4kAutomated safety check: PassMIT
Whodbxiaoyuge886/aigc198—~894Automated safety check: PassMIT
Database Backupssickn33/agentic-awesome-skills47k2 repos~3.1kAutomated safety check: NotesMIT
Database Schema DesignerOneWave-AI/claude-skills336—~1.6kAutomated safety check: PassMIT

Similar skills

  • Database Expert

    cin12211/orca-q

    Database performance optimization, schema design, query analysis, and connection management across PostgreSQL, MySQL, MongoDB, and SQLite with ORM integration.

    224 GitHub stars~2.8k tokensUpdated 18 days ago
    DatabasesAuto-check passed
  • Prisma Database Setup

    curvenote/curvenote

    Guides for configuring Prisma with different database providers (PostgreSQL, MySQL, SQLite, MongoDB, etc.).

    170 GitHub starsUsed in 3 repos~1.4k tokens
    DatabasesAuto-check passed
  • Whodb

    xiaoyuge886/aigc

    Database operations including querying, schema exploration, and data analysis.

    198 GitHub stars~894 tokensUpdated 2 mo ago
    DatabasesAuto-check passed
  • Database Backups

    sickn33/agentic-awesome-skills

    Implement database backup strategies. An agent skill from sickn33/agentic-awesome-skills.

    47k GitHub starsUsed in 2 repos~3.1k tokens
    DatabasesAuto-check: notes
  • Database Schema Designer

    OneWave-AI/claude-skills

    Designs relational and document database schemas from requirements or an existing app - tables and collections, keys, relationships, constraints, indexes driven by real query patterns, ERDs, and…

    336 GitHub stars~1.6k tokensUpdated 8 days ago
    DatabasesAuto-check passed
  • DB Ops Sop

    OpenDCAI/DataMind

    Database operations runbook — backup, recovery, performance tuning, troubleshooting.

    451 GitHub stars~388 tokensUpdated 20 days ago
    DatabasesAuto-check passed

More from jeremylongshore/tons-of-skills-marketplace

All 3,342 skills in this repo
  • Performing Security Code Review

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to conduct a security-focused code review using the security-agent plugin.

    2.8k GitHub starsUsed in 2 repos~1.3k tokens
    Auto-check: notes
  • Adapting Transfer Learning Models

    jeremylongshore/tons-of-skills-marketplace

    Build this skill automates the adaptation of pre-trained machine learning models using transfer learning techniques.

    2.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Agent Context Loader

    jeremylongshore/tons-of-skills-marketplace

    Execute proactive auto-loading: automatically detects and loads agents.md files.

    2.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Aggregating Performance Metrics

    jeremylongshore/tons-of-skills-marketplace

    Aggregate and centralize performance metrics from applications, systems, databases, caches, and services.

    2.8k GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Analyzing Capacity Planning

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to analyze capacity requirements and plan for future growth.

    2.8k GitHub stars~947 tokensUpdated today
    Auto-check passed
  • Analyzing Database Indexes

    jeremylongshore/tons-of-skills-marketplace

    Process use when you need to work with database indexing. An agent skill from jeremylongshore/tons-of-skills-marketplace.

    2.8k GitHub stars~2k tokensUpdated today
    Auto-check passed

Categories

Questions about Automating Database Backups

What does Automating Database Backups do?

Automate database backup processes with scheduling, compression, and encryption. Automating Database Backups is an agent skill from jeremylongshore/tons-of-skills-marketplace. Automate database backup processes with scheduling, compression, and encryption.

When should I use Automating Database Backups?

Automating Database Backups fits situations like: working with automating database backups; with automating.

How do I install Automating Database Backups in Claude Code?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill automating-database-backups -a claude-code`. Or copy the skill folder (skills/.curated/automating-database-backups in jeremylongshore/tons-of-skills-marketplace) into .claude/skills/automating-database-backups in your project. Claude Code loads it when a task matches its description.

How do I install Automating Database Backups in Codex?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill automating-database-backups -a codex`. Or copy the skill folder (skills/.curated/automating-database-backups in jeremylongshore/tons-of-skills-marketplace) into .agents/skills/automating-database-backups in your project. Codex loads it when a task matches its description.

Can I use Automating Database Backups in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill automating-database-backups -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/automating-database-backups, .gemini/skills/automating-database-backups, .github/skills/automating-database-backups and .opencode/skills/automating-database-backups in your project.

What does Automating Database Backups need to run?

Going by SKILL.md and its folder, Automating Database Backups needs Python and a shell for the scripts in its folder, the command-line tools its instructions call (python3 and pg_dump) and credentials named MYSQL_PASSWORD. Our summary lists: Python 3; A Bash shell. Its frontmatter pre-approves these tools: Read, Write, Edit, Grep, Glob, Bash(pg_dump:*), Bash(mysqldump:*), Bash(mongodump:*), Bash(cron:*), Bash(gpg:*). Compatibility (from SKILL.md): Designed for Claude Code.

Does Automating Database Backups access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Automating Database Backups safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Automating Database Backups use?

Automating Database Backups is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Automating Database Backups use?

About 1.5k tokens (SKILL.md is roughly 5.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 9.2k tokens, read only when the agent opens those files.

What are the alternatives to Automating Database Backups?

Skills that share tags, products or a category with Automating Database Backups: Database Expert (cin12211/orca-q, 224 stars), Prisma Database Setup (curvenote/curvenote, 170 stars), Whodb (xiaoyuge886/aigc, 198 stars) and Database Backups (sickn33/agentic-awesome-skills, 47k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Automating Database Backups?

jeremylongshore (a GitHub user) maintains it in jeremylongshore/tons-of-skills-marketplace, which has 2,827 GitHub stars. The repository holds 3,342 skills in this directory. The repository was last updated on October 10, 2026.

Source: jeremylongshore/tons-of-skills-marketplace on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.