Code/backup

backup

Ansible role that can run restic backups and push it to a remote storage server.

yannick

README

Backup

Restic-based backup and restore for Docker Compose services across all hosts.

Key Parameters

Variable Default Description
backup_mode backup Operation mode: backup or restore
backup_services [] (all) Comma-separated service names to target; empty = all discovered
backup_hosts [] (all) Limit to specific hosts; empty = all docker_servers
restic_repo rest:http://storage.home:8000/backup Restic repository URL
restic_password (vault) Repository encryption password
restic_retention_args --keep-last 10 Retention policy passed to restic forget
backup_health_check_timeout 300 Seconds to wait for containers to become healthy after restart

Workflow

  1. Install restic (if backup_auto_install_restic is true)
  2. Initialize restic repository (idempotent)
  3. Discover all Docker Compose services under /docker/ on target hosts
  4. Stop each service's Compose stack
  5. Run restic backup on the service directory (tagged by service name)
  6. Prune old snapshots per retention policy
  7. Restart Compose stack
  8. Wait for health checks to pass

Quick Actions

Browse FilesView Commits
git clone https://rakys.xyz/git/backup.git

Repository Statistics

0
Stars
0
Forks
1
Watchers
0
Issues
Default Branch:main
Primary Language:Jinja
Created:August 23, 2025
Last Updated:March 18, 2026
Repository Size:0.05 KB