Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

restic

БесплатноБез исполняемых скриптовНе проверен

Back up and restore data with Restic. Use when a user asks to set up backups, create encrypted backups, back up to S3 or cloud storage, implement a backup…

TerminalSkillsот TerminalSkills★ 221 звезда на GitHub

Об этом скилле

Restic

Overview

Restic is a fast, secure, and efficient backup program. Every backup is encrypted (AES-256) and deduplicated at the block level, meaning only changed data is stored on subsequent runs. It supports multiple storage backends: local disk, SFTP, S3-compatible storage (AWS, MinIO, Backblaze B2), Azure Blob, Google Cloud Storage, and more. This skill covers repository setup, backup and restore operations, snapshot management, retention policies, and automation.

Instructions

Step 1: Installation

# Ubuntu/Debian
sudo apt install restic

# macOS
brew install restic

# Release binary (any Linux): download the archive and SHA256SUMS, compare, then unpack
curl -sLO https://github.com/restic/restic/releases/download/v0.19.1/restic_0.19.1_linux_amd64.bz2
curl -sLO https://github.com/restic/restic/releases/download/v0.19.1/SHA256SUMS
grep linux_amd64.bz2 SHA256SUMS | sha256sum -c -
bunzip2 restic_0.19.1_linux_amd64.bz2
sudo install -m 0755 restic_0.19.1_linux_amd64 /usr/local/bin/restic

# Verify (0.19.1 was the current release in October 2026)
restic version

The distribution package can be several releases behind; a binary installed this way updates itself with restic self-update.

Step 2: Initialize Repository

# Local repository
restic init --repo /backups/myrepo

# S3 (AWS or S3-compatible like MinIO)
export AWS_ACCESS_KEY_ID=your-key
export AWS_SECRET_ACCESS_KEY=your-secret
restic init --repo s3:s3.us-east-1.amazonaws.com/my-bucket/restic-repo

# MinIO (self-hosted S3)
restic init --repo s3:http://minio.local:9000/backups/restic-repo

# SFTP
restic init --repo sftp:user@backup-server:/data/restic-repo

# Backblaze B2
export B2_ACCOUNT_ID=your-account
export B2_ACCOUNT_KEY=your-key
restic init --repo b2:my-bucket:restic-repo

# restic asks for the repository password on init (twice). For scripts, use
# RESTIC_PASSWORD_FILE (preferred) or RESTIC_PASSWORD_COMMAND; avoid RESTIC_PASSWORD
# in shell history.
restic init --repo /backups/myrepo --password-file /etc/restic/password

Step 3: Create Backups

# Back up a directory
restic -r /backups/myrepo backup /home/maria/documents

# Back up multiple paths
restic -r /backups/myrepo backup /home/maria/documents /var/www /etc

# Exclude patterns
restic -r /backups/myrepo backup /home/maria \
  --exclude="*.tmp" \
  --exclude=".cache" \
  --exclude="node_modules" \
  --exclude=".git"

# Exclude from file
cat > /etc/restic/excludes.txt << 'EOF'
*.tmp
*.log
.cache
node_modules
__pycache__
.git
EOF
restic -r /backups/myrepo backup /home/maria --exclude-file=/etc/restic/excludes.txt

# Back up with tags (for organization)
restic -r /backups/myrepo backup /var/www --tag web --tag production

# Back up stdin (database dumps); the snapshot contains one file named /db_dump.sql
pg_dump mydb | restic -r /backups/myrepo backup --stdin --stdin-filename db_dump.sql --tag database
mysqldump mydb | restic -r /backups/myrepo backup --stdin --stdin-filename mysql_dump.sql --tag database

# Let restic run the command and fail the backup if the command fails (no snapshot
# is saved from a broken dump); everything after -- is the command
restic -r /backups/myrepo backup --stdin-from-command --stdin-filename db_dump.sql --tag database -- pg_dump mydb

Step 4: List and Browse Snapshots

# List all snapshots
restic -r /backups/myrepo snapshots

# Filter by tag
restic -r /backups/myrepo snapshots --tag web

# Filter by host
restic -r /backups/myrepo snapshots --host production-server

# Browse files in a snapshot
restic -r /backups/myrepo ls latest --tag web
restic -r /backups/myrepo ls abc123de --path /var/www

# Compare snapshots
restic -r /backups/myrepo diff abc123 def456

Step 5: Restore Data

# "latest" means the newest snapshot of ANY path, tag or host in the repository. If the
# repository also holds database dumps, plain "latest" may pick the dump instead of your
# files. Narrow it with --tag, --path or --host.

# Restore entire snapshot to a directory
restic -r /backups/myrepo restore latest --tag web --target /restore

# Restore specific path from snapshot
restic -r /backups/myrepo restore latest --tag web --target /restore --include /var/www

# Restore specific file
restic -r /backups/myrepo restore latest --path /etc --target /restore --include /etc/nginx/nginx.conf

# Restore stdin backup (database)
restic -r /backups/myrepo dump latest --tag database db_dump.sql | psql mydb

# Mount snapshots as filesystem (browse interactively)
mkdir /mnt/restic
restic -r /backups/myrepo mount /mnt/restic
# Now browse /mnt/restic/snapshots/ like a normal filesystem

Step 6: Retention Policies (Pruning)

# Keep 7 daily, 4 weekly, 12 monthly and 3 yearly snapshots; --prune then deletes the
# data no remaining snapshot uses. Snapshots are grouped by host and paths first, and
# the policy applies to each group separately.
restic -r /backups/myrepo forget \
  --keep-daily 7 --keep-week
Полный SKILL.md на GitHub

Установить restic в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

_scores.json

FAQ

Что делает скилл restic?

Back up and restore data with Restic. Use when a user asks to set up backups, create encrypted backups, back up to S3 or cloud storage, implement a backup strategy, restore files from backup, deduplicate backup storage, schedule automated backups, back up databases or servers, or set up offsite backups. Covers repository initialization, backup/restore operations, snapshot management, pruning, encryption, and multiple storage backends (local, S3, SFTP, B2, Azure, GCS).

Как установить скилл restic?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл restic запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить restic с