Document Unraid automation schedules
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
# Unraid User Scripts Setup
|
||||
|
||||
This document describes the intended automation path for `pre-backup-dumps.sh`.
|
||||
This document describes the intended automation path for the Borg pre-flight scripts.
|
||||
|
||||
## Decision
|
||||
|
||||
The pre-backup dump refresh should run:
|
||||
The Borg pre-flight should run:
|
||||
|
||||
- on the Unraid host
|
||||
- through the User Scripts plugin or host cron
|
||||
@@ -14,7 +14,13 @@ It should **not** be implemented as a Borg UI inline hook in the current design.
|
||||
|
||||
## Why host-side
|
||||
|
||||
`pre-backup-dumps.sh` currently assumes:
|
||||
`pre-borg.sh` currently chains the host-side checks:
|
||||
|
||||
- `services/posture-check/posture-check.sh`
|
||||
- `ops/borg-ui/scripts/pre-backup-dumps.sh`
|
||||
- `ops/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/...`
|
||||
@@ -24,24 +30,35 @@ That makes host execution simpler, more transparent, and lower-risk than giving
|
||||
|
||||
## Recommended rollout
|
||||
|
||||
1. Store the script on the host, for example at:
|
||||
- `/mnt/user/appdata/borg-ui/scripts/pre-backup-dumps.sh`
|
||||
2. Make it executable:
|
||||
- `chmod +x /mnt/user/appdata/borg-ui/scripts/pre-backup-dumps.sh`
|
||||
3. Create a User Scripts entry such as:
|
||||
1. Use the repo clone on the host:
|
||||
- `/mnt/user/services/homelab-infra`
|
||||
2. Make the scripts executable:
|
||||
- `chmod +x /mnt/user/services/homelab-infra/ops/borg-ui/scripts/pre-borg.sh`
|
||||
- `chmod +x /mnt/user/services/homelab-infra/ops/borg-ui/scripts/pre-backup-dumps.sh`
|
||||
3. Create a User Scripts entry:
|
||||
- `borg-pre-backup-dumps`
|
||||
4. Let that entry run:
|
||||
- on a fixed schedule before the expected Borg backup window
|
||||
- or manually before ad hoc Borg runs
|
||||
5. Keep Borg UI focused on backing up `/local/borg-dumps`, not on generating the dumps itself.
|
||||
4. Script body:
|
||||
|
||||
```bash
|
||||
#!/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
|
||||
```
|
||||
|
||||
5. Schedule: daily at `04:00`, before the expected Borg backup window.
|
||||
6. Keep Borg UI focused on backing up `/local/borg-dumps`, not on generating the dumps itself.
|
||||
|
||||
## Operational model
|
||||
|
||||
The intended sequence is:
|
||||
|
||||
1. Host script refreshes `latest` dump artifacts.
|
||||
2. Borg UI backs up `/local/borg-dumps` together with the rest of `critical_infra`.
|
||||
3. Borg history preserves dump history, so the host only needs to keep the most recent dump set.
|
||||
1. Host wrapper checks posture.
|
||||
2. Host script refreshes `latest` dump artifacts.
|
||||
3. Freshness check verifies expected dumps.
|
||||
4. Borg UI backs up `/local/borg-dumps` together with the rest of `critical_infra`.
|
||||
5. Borg history preserves dump history, so the host only needs to keep the most recent dump set.
|
||||
|
||||
## Current dump target
|
||||
|
||||
|
||||
Reference in New Issue
Block a user