From 3779002a3da5ce66cdcf7bd75e0a03287f9a66fb Mon Sep 17 00:00:00 2001 From: William Petit Date: Tue, 13 Oct 2020 17:16:20 +0200 Subject: [PATCH] Create and set ownership to backup directory --- debian/postgres-backup.dirs | 1 + debian/postgres-backup.postinst | 4 ++++ debian/rules | 1 - 3 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 debian/postgres-backup.dirs create mode 100644 debian/postgres-backup.postinst diff --git a/debian/postgres-backup.dirs b/debian/postgres-backup.dirs new file mode 100644 index 0000000..c896bd1 --- /dev/null +++ b/debian/postgres-backup.dirs @@ -0,0 +1 @@ +/var/backups/database/postgresql \ No newline at end of file diff --git a/debian/postgres-backup.postinst b/debian/postgres-backup.postinst new file mode 100644 index 0000000..a05b58d --- /dev/null +++ b/debian/postgres-backup.postinst @@ -0,0 +1,4 @@ +#!/bin/bash + +mkdir -p /var/backups/database/postgresql +chown -R postgres:postgres /var/backups/database/postgresql \ No newline at end of file diff --git a/debian/rules b/debian/rules index 340e69c..5af568d 100644 --- a/debian/rules +++ b/debian/rules @@ -20,6 +20,5 @@ override_dh_auto_install: chmod +x debian/postgres-backup/usr/share/postgres-backup/pg_backup.sh install -D -m 644 debian/postgres-backup.timer debian/postgres-backup/lib/systemd/system/postgres-backup.timer - install -d -o postgres -g postgres debian/postgres-backup/var/backups/database/postgresql install -d debian/postgres-backup \ No newline at end of file