2.3 KiB
2.3 KiB
Unraid User Scripts Setup
This document describes the intended automation path for the Borg pre-flight scripts.
Decision
The Borg pre-flight should run:
- on the Unraid host
- through the User Scripts plugin or host cron
- before the Borg UI repository job starts
It should not be implemented as a Borg UI inline hook in the current design.
Why host-side
pre-borg.sh currently chains the host-side checks:
services/posture-check/posture-check.shops/borg-ui/scripts/pre-backup-dumps.shincluding the Unraid flash config archiveops/restore-tests/check-restore-freshness.sh
The dump step assumes:
- access to the host Docker daemon via
docker exec - access to host paths under
/mnt/user/... - the ability to write fresh dump artifacts into the shared dump directory
That makes host execution simpler, more transparent, and lower-risk than giving Borg UI additional host-level responsibilities.
Recommended rollout
- Use the repo clone on the host:
/mnt/user/services/homelab-infra
- Make the scripts executable:
chmod +x /mnt/user/services/homelab-infra/ops/borg-ui/scripts/pre-borg.shchmod +x /mnt/user/services/homelab-infra/ops/borg-ui/scripts/pre-backup-dumps.sh
- Create a User Scripts entry:
borg-pre-backup-dumps
- Script body:
#!/bin/bash
REPO_ROOT=/mnt/user/services/homelab-infra \
DUMP_ROOT=/mnt/user/backups/borg/dumps \
ALLOW_POSTURE_WARNING=1 \
bash /mnt/user/services/homelab-infra/ops/borg-ui/scripts/pre-borg.sh
- Schedule: daily at
04:00, before the expected Borg backup window. - Keep Borg UI focused on backing up
/local/borg-dumps, not on generating the dumps itself.
Operational model
The intended sequence is:
- Host wrapper checks posture.
- Host script refreshes
latestdump artifacts. - Host script writes
unraid-flash-config.tar.gzplus checksum and manifest into the same dump set. - Freshness check verifies expected dumps and the flash config archive.
- Borg UI backs up
/local/borg-dumpstogether with the rest ofcritical_infra. - Borg history preserves dump history, so the host only needs to keep the most recent dump set.
Current dump target
/mnt/user/backups/borg/dumps/latest
This target is intentionally separate from live app state so that dump artifacts live under the backup share instead of appdata.