Files
configpolicy/roles/wal-g-pg/files/wal-g-backup.service
Dustin C. Hatch 2e37fce4f6 r/wal-g-pg: Run wal-g backup as postgres
`wal-g` needs to connect to the PostgreSQL database system, so it should
run as the _postgres_ user, who has permission to connect, rather than
_root_, who does not.
2024-08-30 09:44:43 -05:00

11 lines
264 B
Desktop File

[Unit]
Description=PostgreSQL Backup with WAL-G
Wants=network-online.target
After=network-online.target
[Service]
Type=oneshot
Environment=PGDATA=/var/lib/pgsql/data
ExecStart=/usr/bin/wal-g-pg backup-push --config /etc/postgresql/wal-g.yml $PGDATA
User=postgres