aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarlo Landmeter <clandmeter@alpinelinux.org>2018-02-03 21:15:57 +0000
committerCarlo Landmeter <clandmeter@alpinelinux.org>2018-02-03 21:15:57 +0000
commit4bdc1a801b89307f5b63e2f86edfad36ad5d7b06 (patch)
tree1b530d3d5e51f7766521d7269d1abf4c8e13776e
parente611c886b159b67e41278373ccd348b6c46573c9 (diff)
downloadalpine-backup-4bdc1a801b89307f5b63e2f86edfad36ad5d7b06.tar.bz2
alpine-backup-4bdc1a801b89307f5b63e2f86edfad36ad5d7b06.tar.xz
add pgsql dump profile
-rwxr-xr-xprofiles/backup-pgsql13
1 files changed, 13 insertions, 0 deletions
diff --git a/profiles/backup-pgsql b/profiles/backup-pgsql
new file mode 100755
index 0000000..89fa6a3
--- /dev/null
+++ b/profiles/backup-pgsql
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+# To dump pgsql databases make sure to export the following variables.
+# This can be done from /etc/lbu/rbu.conf or add it to this file.
+# PGUSER, PGPASSWORD, PGHOST, PGDATABASE
+# Set GZIP to pigz for multi core compression (if installed)
+
+if [ -n "$PGPASSWORD" ]; then
+ echo "Dumping PostgreSQL database to: $BACKUP_CACHE"
+ pg_dump | ${GZIP:-gzip} > "$BACKUP_CACHE"/dump.sql.gz
+else
+ echo "PostgreSQL password not set, skipping pg_dump."
+fi