add readme

This commit is contained in:
2026-03-13 09:39:10 +00:00
parent a772f59ac3
commit 96e949c27a

54
README.md Normal file
View File

@@ -0,0 +1,54 @@
# 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 3 * * * /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/
```