backup-restore

backup-restore is a skill for Claude Code, Codex from JansenAnalytics/claudex. It costs 39 tokens per session (503 once invoked), scanned A, original, MIT.

A set of scripts for backing up databases and files, checking backup integrity, restoring data, and removing old backups.

In plain words
What is it for?
It helps create compressed PostgreSQL, SQLite, or directory backups, verify them, restore them to a target, apply retention rules, and schedule jobs with cron.
Why use it?
It reduces the risk of losing data and makes recovery steps repeatable when a database, file set, or server fails.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/jansenanalytics/claudex/backup-restore
Any agent
npx skills add JansenAnalytics/claudex --skill backup-restore
Clone the repo
git clone --depth 1 https://github.com/JansenAnalytics/claudex

Made for: Claude Code, Codex.

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 backup-restore

README.md
[![agentmods](https://agentmods.dev/badge/skills/jansenanalytics/claudex/backup-restore.svg)](https://agentmods.dev/skills/jansenanalytics/claudex/backup-restore)
Your own site
<a href="https://agentmods.dev/skills/jansenanalytics/claudex/backup-restore"><img src="https://agentmods.dev/badge/skills/jansenanalytics/claudex/backup-restore.svg" alt="Measured on agentmods" height="20"></a>
Per session 39 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 503 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00039 $0.00503
Opus 5 $0.00019 $0.00251
Sonnet 5 $0.00008 $0.00101
Haiku 4.5 $0.00004 $0.00050

Measured 4d ago against content hash f40f773f8258, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

backup-restore scanned grade A with 0 findings 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 4d 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/backup-restore/SKILL.md · 70 lines

How it starts

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

backup-restore

Automated backup strategies: database dumps, file snapshots, incremental backups, verification, disaster recovery. Use when: setting up backup schedules, creating database backups, restoring from backups, verifying backup integrity, or planning disaster recovery.

Workflows

Create a backup

bash scripts/backup.sh --type <pg|sqlite|files> --source <path-or-db> --dest <backup-dir>

Creates timestamped, compressed backups. Supports PostgreSQL, SQLite, and file directories.

Restore from backup

bash scripts/restore.sh --type <pg|sqlite|files> --backup <backup-file> --dest <target>

Restores from a backup archive. Prompts for confirmation before overwriting.

Verify backup integrity

bash scripts/verify-backup.sh <backup-file>

Checks checksums, tests archive integrity, and validates contents.

Clean up old backups (retention)

bash scripts/retention-cleanup.sh <backup-dir> [--keep-days 30] [--keep-count 10]

Removes old backups based on age or count, keeping minimum required.

Set up cron schedule

bash scripts/cron-setup.sh --schedule "0 2 * * *" --command "bash /path/to/backup.sh ..."

Adds a cron entry for automated backups.

Scripts

Script Purpose
scripts/backup.sh Universal backup (pg/sqlite/files)
scripts/restore.sh Restore from backup
scripts/verify-backup.sh Verify backup integrity
scripts/retention-cleanup.sh Clean old backups
scripts/cron-setup.sh Set up cron schedule

References

File Contents
references/backup-strategies.md 3-2-1 rule, patterns, restore testing

Read the full file on GitHub · 70 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. 4d ago First seen · 70 lines · 39 tokens per session scan A f40f773f8258

Subscribe to this mod's changes

backup-restore is a skill published in the GitHub repository JansenAnalytics/claudex (5 stars, last pushed 2mo ago), licensed MIT. It adds 39 tokens to every session and 503 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.