diff --git a/Backups.md b/Backups.md new file mode 100644 index 0000000..9a792c6 --- /dev/null +++ b/Backups.md @@ -0,0 +1,36 @@ +# Backups + +Daily backups run from **root's crontab** (`sudo crontab -e`). + +## Gitea + +See [[Gitea#Backup]] for details. + +``` +0 3 * * * /home/alvis/agap_git/gitea/backup.sh >> /mnt/backups/gitea/cron.log 2>&1 +``` + +Output: `/mnt/backups/gitea/gitea-dump-*.zip` + +## DBS (databases) + +Rsync of all databases from SSD to backup volume. + +``` +30 3 * * * rsync -a --delete /mnt/ssd/dbs/ /mnt/backups/dbs/ >> /mnt/backups/dbs/cron.log 2>&1 && touch /mnt/backups/dbs/.last_sync +``` + +Source: `/mnt/ssd/dbs/` (gitea, otter, pihole, qdrant, zabbix) +Destination: `/mnt/backups/dbs/` + +## Zabbix Monitoring + +Both backups are monitored via Zabbix agent on host `AgapHost`. + +| Item key | Description | Trigger | +|----------|-------------|---------| +| `gitea.backup.status` | `1` if last dump succeeded | — | +| `gitea.backup.age` | Seconds since last dump zip | High if > 25h | +| `dbs.backup.age` | Seconds since last rsync (`.last_sync` mtime) | High if > 25h | + +Agent config: `/etc/zabbix/zabbix_agent2.d/gitea_backup.conf` diff --git a/Home.md b/Home.md index cfa59ac..32c00a0 100644 --- a/Home.md +++ b/Home.md @@ -4,6 +4,7 @@ - [[Network]] — Netplan, Caddy, port forwarding - [[Storage]] — LVM setup +- [[Backups]] — Gitea and database backups ## Services