From 712626737451089f49db41611805f0b63774e16a Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Sun, 8 Jun 2014 08:47:07 +0200 Subject: [PATCH] Make a way to run a pg base backup for only a single cluster --- .../backup_server/postgres-make-base-backups | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/modules/postgres/files/backup_server/postgres-make-base-backups b/modules/postgres/files/backup_server/postgres-make-base-backups index 9a9d18803..d96aeee79 100755 --- a/modules/postgres/files/backup_server/postgres-make-base-backups +++ b/modules/postgres/files/backup_server/postgres-make-base-backups @@ -47,6 +47,18 @@ else console="" fi +if [ "${1:-}" = "-h" ] || [ "${1:-}" = "--help" ]; then + echo "Usage: $0 [:]" + exit 0 +fi + +if [ "$#" -gt 0 ]; then + forcehostport="$1" + shift +else + forcehostport="" +fi + export PGSSLMODE=verify-full export PGSSLROOTCERT=/etc/ssl/debian/certs/ca.crt @@ -55,6 +67,11 @@ date=$(date "+%Y%m%d-%H%M%S") while read host port username cluster version; do [ "${host#\#}" = "$host" ] || continue + if [ -n "$forcehostport" ] && [ "$forcehostport" != "$host:$port" ]; then + [ "$verbose" -gt 0 ] && echo "Skipping $host:$port $version/$cluster." + continue + fi + label="$date-$host-$cluster-$version-backup" [ "$verbose" -gt 0 ] && echo "Doing $host:$port $version/$cluster: $label" -- 2.20.1