Files
gitea/README.md

55 lines
1.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Gitea Backup (Docker + SQLite)
Dieses Setup erstellt tägliche Backups der kompletten Gitea-Daten unter Docker.
Es basiert auf der offiziellen Gitea-Dokumentation, die bestätigt, dass alle relevanten Daten
(inkl. SQLite-Datei) im `data/`-Verzeichnis liegen, während XORMSQLDumps
bekannte Restore-Probleme haben.
## Features
- Vollständiges Dateibackup (`/data/gitea`)
- Automatisches tägliches Backup (03:00 Uhr)
- TAR-Archive in `backup/output/`
- Keine XORM-Dumps (unzuverlässig laut Doku)
## Nutzung
### Backup-Script
`backup/backup.sh` erstellt ein TAR-Archiv des gesamten Gitea-Datenverzeichnisses:
```sh
tar -czvf "/backup/output/gitea-$(date +%Y%m%d-%H%M).tar.gz" /data/gitea
```
### Crontab
`backup/crontab` führt das Backup täglich aus:
```
0 1 * * * /backup/backup.sh >> /backup/cron.log 2>&1
```
Dateirechte:
```sh
sudo chown root:root backup/crontab
sudo chmod 644 backup/crontab
chmod +x backup/backup.sh
```
### Restore
```sh
docker stop gitea
tar -xzvf gitea-YYYYMMDD-HHMM.tar.gz -C ./data
docker start gitea
```
## GitIgnore
```gitignore
backup/output/
```