Add Immich backup setup and Zabbix monitoring

2026-03-07 18:26:49 +00:00
parent 0824ae9b0a
commit abbea635ae

@@ -12,6 +12,24 @@ See [[Gitea#Backup]] for details.
Output: `/mnt/backups/gitea/gitea-dump-*.zip`
## Immich (photos)
Script: `immich-app/backup.sh` — dumps DB first, then rsyncs originals to backup volume. Runs at 02:30 (after Immich's built-in dump at 02:00).
```
30 2 * * * /home/alvis/agap_git/immich-app/backup.sh >> /mnt/backups/media/cron.log 2>&1
```
| What | Source | Destination |
|------|--------|-------------|
| DB dump | `immich_postgres` container | `/mnt/backups/media/backups/immich-db-*.sql.gz` |
| Photos | `/mnt/media/upload/library/` | `/mnt/backups/media/library/` |
| Uploads | `/mnt/media/upload/upload/` | `/mnt/backups/media/upload/` |
| Profiles | `/mnt/media/upload/profile/` | `/mnt/backups/media/profile/` |
Thumbnails and encoded video are skipped — they can be regenerated by Immich.
DB dumps are retained for 14 days.
## DBS (databases)
Rsync of all databases from SSD to backup volume.
@@ -32,5 +50,6 @@ Both backups are monitored via Zabbix agent on host `AgapHost`.
| `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 |
| `immich.backup.age` | Seconds since last immich backup (`.last_sync` mtime) | High if > 25h |
Agent config: `/etc/zabbix/zabbix_agent2.d/gitea_backup.conf`