File: pgbackrest.postinst

package info (click to toggle)
pgbackrest 2.45-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 49,372 kB
  • sloc: ansic: 104,454; perl: 22,386; xml: 16,649; sh: 3,578; pascal: 2,613; makefile: 262; sql: 32
file content (26 lines) | stat: -rw-r--r-- 482 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/sh

set -e

case $1 in
    configure)
	# Make sure we set the permissions only if no previous version
	# was installed.
	if test -z $2; then
	    USER="postgres"
	    GROUP="postgres"

	    DIRS="/var/log/pgbackrest /var/lib/pgbackrest /var/spool/pgbackrest"
	    for dir in $DIRS; do
		mkdir -p $dir
		chown ${USER}:${GROUP} $dir
		chmod 0750 $dir
	    done

	    chown ${USER}:${GROUP} /etc/pgbackrest.conf
	    chmod 0640 /etc/pgbackrest.conf
	fi
    ;;
esac

#DEBHELPER#