add readme
This commit is contained in:
54
README.md
Normal file
54
README.md
Normal 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 XORM‑SQL‑Dumps
|
||||||
|
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/
|
||||||
|
```
|
||||||
|
|
||||||
Reference in New Issue
Block a user