agentleFS
fredoliveirafredoliveira/agents/skills/backup-vault/SKILL.md

backup-vault

Skill24 starsChanged 5 months agoMITView on GitHub

Create a dated zip backup of the Obsidian vault and rotate old backups on a grandfather-father-son schedule (14 daily, 5 weekly, 12 monthly, 5 yearly). Use when asked to back up the vault, make a snapshot, or run/prune vault backups.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Keep a rolling set of zip snapshots of the vault in ~/Documents/obsidian/backups, pruned to a grandfather-father-son (GFS) retention …

    line 10

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Vault backup & rotation

Purpose

Keep a rolling set of zip snapshots of the vault in ~/Documents/obsidian/backups, pruned to a grandfather-father-son (GFS) retention schedule so the backup folder stays bounded instead of growing forever.

The actual work is done by backup.sh (next to this file) — the logic is deterministic, so run the script rather than reimplementing it by hand.

Retention schedule

A backup is kept if any tier wants it; everything else is deleted.

TierRule
Dailyevery backup from the last 14 days
Weeklynewest backup of each of the 5 most recent ISO weeks
Monthlynewest backup of each of the 12 most recent months
Yearlynewest backup of each of the 5 most recent years

Tunable at the top of backup.sh (DAILY_DAYS, WEEKLY_KEEP, MONTHLY_KEEP, YEARLY_KEEP).

What gets backed up

  • The full vault at ~/Documents/obsidian/umwelt, including .obsidian (themes, plugins, settings) so a restore reproduces the exact setup.
  • Excluded: .DS_Store, .Trash/, and the backup directory itself.
  • Archives are named umwelt-YYYY-MM-DD.zip and contain a top-level umwelt/ folder, so restoring is just unzip umwelt-<date>.zip.

Instructions

  1. Run the script:
    bash ~/.claude/skills/backup-vault/backup.sh
    • Preview without changing anything: bash .../backup.sh --dry-run
    • Override paths if needed: VAULT_DIR=... BACKUP_DIR=... bash .../backup.sh
  2. Report the summary line (how many backups were created / kept / pruned) and the resulting archive size.

The script is idempotent per day: at most one backup is created per calendar date, so it's safe to run repeatedly. Running it both creates today's snapshot and applies retention in one pass.

Notes

  • This is local only. To replicate offsite, rsync the backups/ directory to the remote target after running the script, e.g. rsync -a --delete ~/Documents/obsidian/backups/ <remote>:obsidian-backups/. Because retention deletes files locally, use --delete so the remote mirrors the same pruned set.
  • For unattended daily runs, schedule the script (launchd/cron, or the /schedule skill). Nothing in the script needs an interactive session.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.