Compare commits
1 Commits
pkg/dev/ub
...
pkg/dev/ub
Author | SHA1 | Date | |
---|---|---|---|
debd11ab6f |
@ -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
|
||||
|
1
debian/postgres-backup.dirs
vendored
1
debian/postgres-backup.dirs
vendored
@ -1 +0,0 @@
|
||||
/var/backups/database/postgresql
|
5
debian/postgres-backup.links
vendored
5
debian/postgres-backup.links
vendored
@ -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
|
4
debian/postgres-backup.postinst
vendored
4
debian/postgres-backup.postinst
vendored
@ -1,4 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
mkdir -p /var/backups/database/postgresql
|
||||
chown -R postgres:postgres /var/backups/database/postgresql
|
3
debian/postgres-backup.service
vendored
3
debian/postgres-backup.service
vendored
@ -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
3
debian/rules
vendored
@ -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
|
@ -24,7 +24,7 @@ done
|
||||
|
||||
if [ $# = 0 ]; then
|
||||
SCRIPTPATH=$(cd ${0%/*} && pwd -P)
|
||||
source $SCRIPTPATH/pg_backup.conf
|
||||
source $SCRIPTPATH/pg_backup.config
|
||||
fi;
|
||||
|
||||
###########################
|
||||
|
Reference in New Issue
Block a user