HA stage 0: health reads workers registry, daily pg_dump timer, backup freshness in monitor (#48)

Co-authored-by: host <host@test.local>
This commit is contained in:
openqjandhost authored and GitHub committed 2026-10-26 23:51:54 +08:00
1 parent 275de39148
commit 455513dd33
6 files changed
+150 -10

No files matched your search

+17
View File
@@ -0,0 +1,17 @@
# 每日 Postgres 备份服务(HA 阶段 0)。
#
# 注意:unit 文件不在 deploy tar 里,改动后须单独 scp 到
# /etc/systemd/system/ 再 daemon-reload + enable + start,不要只重启服务。
# 本 service 以 root 跑,只因为要读 0600 的 /etc/codex-app-server/env;
# 备份文件由 UMask=0077 压成 600,目录由 pg-backup.sh 压成 700。
[Unit]
Description=Daily Postgres backup for codex-app-server
# 注意:codex-postgres 是 docker 容器、不是 systemd 服务,这里不写
# After/Wants;Postgres 不可达时 pg_dump 直接失败、service 失败可见。
[Service]
Type=oneshot
User=root
UMask=0077
EnvironmentFile=/etc/codex-app-server/env
ExecStart=/bin/sh /opt/codex-app-server/deploy/pg-backup.sh