backup-automation/backup-automation-structure.md

65 lines
2.4 KiB
Markdown

# Backup-Automation Projekt - Git-Struktur
```
backup-automation/
├── README.md # Gesamtdokumentation
├── .gitignore
├── kestra/
│ └── workflows/
│ ├── backup-provision.yaml # Hauptworkflow: Netbox→Ansible→Backup
│ └── backup-status-check.yaml # Tägliche Status-Checks
├── ansible/
│ ├── inventory/
│ │ └── dynamic_inventory.py # Netbox-Integration
│ ├── playbooks/
│ │ ├── install-borg-client.yaml # Borg auf Clients
│ │ ├── configure-backup-server.yaml # Backup-Server Setup
│ │ └── update-backup-config.yaml # Config-Updates
│ ├── roles/
│ │ ├── borg-client/
│ │ │ ├── tasks/main.yaml
│ │ │ ├── templates/
│ │ │ │ ├── borg-backup.sh.j2
│ │ │ │ ├── pre-backup-docker.sh.j2
│ │ │ │ └── systemd-timer.j2
│ │ │ └── handlers/main.yaml
│ │ └── backup-server/
│ │ ├── tasks/main.yaml
│ │ ├── templates/
│ │ │ ├── rclone.conf.j2
│ │ │ └── rclone-sync.service.j2
│ │ └── files/
│ └── group_vars/
│ ├── all.yaml
│ └── backup_clients.yaml
├── scripts/
│ ├── borg-backup-wrapper.sh # Lokaler Wrapper auf jedem Host
│ ├── docker-volume-dump.sh # Docker-spezifische Pre-Backup
│ ├── backup-status-reporter.sh # Status an Kestra zurück
│ └── restore-from-borg.sh # Restore-Hilfsskript
├── docs/
│ ├── architecture.md
│ ├── setup-guide.md
│ ├── troubleshooting.md
│ └── restore-procedures.md
└── examples/
├── kestra-flow.yaml.example
├── netbox-tag.example
└── s3-structure.example
```
## Ablauf:
1. **Kestra startet täglich** (z.B. 02:00)
2. **Abfrage Netbox API**: Alle Systeme mit TAG `backup=true`
3. **Pro System**: Trigger Ansible gegen diesen Host
4. **Ansible**:
- Prüft ob Borg installiert
- Wenn nicht: installiert + konfiguriert
- Stellt Backup-Scripts bereit
- Startet Borg Backup via Systemd
5. **Borg läuft** auf jedem Host (inkrementell)
6. **Backup-Server** sammelt alle Borg-Repos
7. **Rclone** syncronisiert nightly nach S3