interplane-forge
INTERPLANE Forge
Brought by drakestapleton
interplane-forge / infra / spark / aien-run-forgejo-backup.service
| 1 | [Unit] |
| 2 | Description=Forgejo snapshot whenever a repository ref moves, at most every 6 h and at least daily (continuous; aien-onchange on refs, replaces atlas-forgejo-backup.timer) |
| 3 | # Source of record: ~/work/forge/web/infra/spark/aien-run-forgejo-backup.service; migration in infra/RUNBOOK.md. |
| 4 | # Runs ~/.local/bin/forgejo-backup (patched copy: infra/spark/forgejo/forgejo-backup). Watches the |
| 5 | # bare repos' ref dirs only, not data/: the backup stops and starts Forgejo, which writes data/ |
| 6 | # and would trigger itself. MAX 86400 keeps today's daily floor; MIN 21600 caps the outage cost |
| 7 | # (each snapshot stops Forgejo for about a minute). |
| 8 | # Do NOT start before the Forgejo runtime is restored (infra/spark/forgejo/forgejo-runtime-restore.sh) |
| 9 | # and Forgejo is healthy; then stop and disable atlas-forgejo-backup.timer in the same change. |
| 10 | # ExecCondition skips cleanly (no restart loop of failures) while the encrypted storage is unmounted. |
| 11 | |
| 12 | [Service] |
| 13 | Type=simple |
| 14 | Environment=PATH=/usr/bin:/bin |
| 15 | ExecCondition=/usr/bin/mountpoint -q %h/atlas-forgejo/data |
| 16 | ExecStart=%h/work/forge/web/infra/ops/onchange-glob.sh 21600 86400 %h/atlas-forgejo/data/git/repositories %h/atlas-forgejo/data/git/repositories/*/ %h/atlas-forgejo/data/git/repositories/*/*.git/refs/**/ -- %h/.local/bin/forgejo-backup |
| 17 | Restart=always |
| 18 | RestartSec=10 |
| 19 | Nice=10 |
| 20 | IOSchedulingClass=idle |
| 21 | UMask=0077 |
| 22 | TimeoutStopSec=15min |
| 23 | |
| 24 | [Install] |
| 25 | WantedBy=default.target |