luminare.gameserver · v0.2.0
0013. Local backups before every switch, off-host copies with any tool
- Status: accepted
- Date: 2026-10-21
Context
The collection says it backs up game servers. What changes with an update or an operator mistake is server-data (configuration, resources) and txData (admin accounts, player database). The sibling collection plans a restic role for off-host backups, but this collection must not depend on it, and a backup taken right before a build switch has to exist even on hosts without any backup system.
Considered options
- Only document which paths an off-host backup tool should copy.
- A local backup script: one zstd-compressed tar archive of server-data and txData in
/var/backups/fxserver, run with the server stopped before every build switch (before the same run writes server-data orsecrets.cfg) and optionally by a daily timer, newestfxserver_backup_keeparchives kept; plus the same paths documented for off-host tools such as restic. - Run restic from this role.
Decision
Chosen option 2. The script runs as root, writes the archive under a temporary name and renames it
when it is complete, keeps archives readable by root only (they contain secrets.cfg), leaves out
the rebuildable server-data/cache, and can write
fxserver_backup_last_success_timestamp_seconds for the node_exporter textfile collector. The
paths are a role variable (fxserver_backup_paths), so an off-host tool can reuse the same list.
Option 3 would tie this role to one backup tool and its credentials.
Consequences
- Good: every update and rollback has a consistent backup taken just before it, with the
server-data and
secrets.cfgof the previous run even when the same run also changes them. - Bad: during an update the server is down a little longer, because the role writes server-data
and
secrets.cfgafter the stop; if that step fails, the role starts the old build again. - Good: a restore is one
tarcommand; the archives work without extra software beyondzstd. - Bad: local archives do not survive the loss of the host; off-host copies are the operator’s job.
- Bad: the timer backup runs while the server writes, so a file changed during the run can be inconsistent in that archive (tar reports it).
Not affiliated with or endorsed by Cfx.re, Rockstar Games or Take-Two.
docs/adr/0013-local-backups-before-every-switch.md on GitHub
Licensed under Apache-2.0. Source: luminare-dev/ansible-collection-gameserver at v0.2.0.