summaryrefslogtreecommitdiffstats
path: root/systemd/system/pg_basebackup@.service
blob: 011c11e28e74ea0f2eb7eb2486c4760cd0945435 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
[Unit]
Description=Basebackup of PostgreSQL Cluster %i
AssertPathExists=/etc/postgresql/%I/postgresql.conf
Wants=postgresql@%i.service
After=postgresql@%i.service
RequiresMountsFor=/var/backups/postgresql

[Service]
Type=oneshot
User=postgres
Environment="KEEP=3"
ExecStartPre=+/usr/bin/pg_backupcluster %i createdirectory
ExecStart=/usr/bin/pg_backupcluster %i basebackup
ExecStart=/usr/bin/pg_backupcluster %i expirebasebackups $KEEP