6 Commits

9 changed files with 67 additions and 0 deletions

1
debian/compat vendored Normal file
View File

@ -0,0 +1 @@
9

14
debian/control vendored Normal file
View File

@ -0,0 +1,14 @@
Source: postgres-backup
Section: unknown
Priority: optional
Maintainer: Cadoles <contact@cadoles.com>
Build-Depends: debhelper (>= 8.0.0), dh-systemd (>= 1.5)
Standards-Version: 3.9.4
Homepage: http://forge.cadoles.com/Cadoles/postgres-backup
Vcs-Git: http://forge.cadoles.com/Cadoles/postgres-backup.git
Vcs-Browser: http://forge.cadoles.com/Cadoles/postgres-backup
Package: postgres-backup
Architecture: amd64
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: PostgreSQL backup scripts

1
debian/postgres-backup.dirs vendored Normal file
View File

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

2
debian/postgres-backup.links vendored Normal file
View File

@ -0,0 +1,2 @@
/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

4
debian/postgres-backup.postinst vendored Normal file
View File

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

10
debian/postgres-backup.service vendored Normal file
View File

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

9
debian/postgres-backup.timer vendored Normal file
View File

@ -0,0 +1,9 @@
[Unit]
Description=Timer for periodic execution of postgres-backup service.
[Timer]
OnCalendar=daily
Persistent=true
[Install]
WantedBy=timers.target

25
debian/rules vendored Normal file
View File

@ -0,0 +1,25 @@
#!/usr/bin/make -f
# -*- makefile -*-
# Uncomment this to turn on verbose mode.
export DH_VERBOSE=1
%:
dh $@ --with systemd
override_dh_auto_install:
mkdir -p debian/postgres-backup/usr/share/postgres-backup
mkdir -p debian/postgres-backup/etc/postgres-backup
mkdir -p debian/postgres-backup/usr/bin
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
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

1
debian/source/format vendored Normal file
View File

@ -0,0 +1 @@
3.0 (native)