interplane.Get Omega
Read in your language

interplane-forge

INTERPLANE Forge

Brought by drakestapleton

branch main Branches Tags History

interplane-forge / infra / spark / aien-run-forgejo-backup.service

25 lines · 1411 bytes Raw Blame History
1[Unit]
2Description=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]
13Type=simple
14Environment=PATH=/usr/bin:/bin
15ExecCondition=/usr/bin/mountpoint -q %h/atlas-forgejo/data
16ExecStart=%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
17Restart=always
18RestartSec=10
19Nice=10
20IOSchedulingClass=idle
21UMask=0077
22TimeoutStopSec=15min
23
24[Install]
25WantedBy=default.target