1 Commits

Author SHA1 Message Date
debd11ab6f Fix links 2020-10-13 15:46:07 +02:00
7 changed files with 8 additions and 14 deletions

View File

@ -4,7 +4,7 @@
# Optional system user to run backups as. If the user the script is running as doesn't match this
# the script terminates. Leave blank to skip check.
BACKUP_USER=postgres
BACKUP_USER=
# Optional hostname to adhere to pg_hba policies. Will default to "localhost" if none specified.
HOSTNAME=
@ -14,7 +14,7 @@ USERNAME=
# This dir will be created if it doesn't exist. This must be writable by the user the script is
# running as.
BACKUP_DIR=/var/backups/database/postgresql/
BACKUP_DIR=/home/backups/database/postgresql/
# List of strings to match against in database name, separated by space or comma, for which we only
# wish to keep a backup of the schema, not the data. Any database names which contain any of these

View File

@ -1 +0,0 @@
/var/backups/database/postgresql

View File

@ -1,2 +1,3 @@
/usr/share/postgres-backup/pg_backup.sh /usr/bin/pg_backup.sh
/usr/share/postgres-backup/pg_backup_rotated.sh /usr/bin/pg_backup_rotated.sh
/etc/postgres-backup/pg_backup.conf /usr/share/postgres-backup/pg_backup.conf
/usr/bin/pg_backup.sh /usr/share/postgres-backup/pg_backup.sh
/usr/bin/pg_backup_rotated.sh /usr/share/postgres-backup/pg_backup_rotated.sh

View File

@ -1,4 +0,0 @@
#!/bin/bash
mkdir -p /var/backups/database/postgresql
chown -R postgres:postgres /var/backups/database/postgresql

View File

@ -3,8 +3,7 @@ Description=Run PostgreSQL backup
[Service]
Type=oneshot
ExecStart=/usr/bin/pg_backup_rotated.sh -c /etc/postgres-backup/pg_backup.conf
User=postgres
ExecStart=/usr/bin/pg_backup_rotated.sh
[Install]
WantedBy=default.target

3
debian/rules vendored
View File

@ -14,12 +14,11 @@ override_dh_auto_install:
cp script/pg_backup.sh debian/postgres-backup/usr/share/postgres-backup/pg_backup.sh
cp script/pg_backup_rotated.sh debian/postgres-backup/usr/share/postgres-backup/pg_backup_rotated.sh
cp conf/pg_backup.conf debian/postgres-backup/etc/postgres-backup/pg_backup.conf
cp conf/pg_backup.conf debian/postgres-backup/usr/share/postgres-backup/pg_backup.conf
chmod +x debian/postgres-backup/usr/share/postgres-backup/pg_backup_rotated.sh
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

View File

@ -24,7 +24,7 @@ done
if [ $# = 0 ]; then
SCRIPTPATH=$(cd ${0%/*} && pwd -P)
source $SCRIPTPATH/pg_backup.conf
source $SCRIPTPATH/pg_backup.config
fi;
###########################