X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;ds=sidebyside;f=modules%2Fpostgres%2Ffiles%2Fbackup_server%2Fpostgres-make-base-backups;h=8b74853c9ef2efc38045ab0a2c8b2a38425907ba;hb=5ae1950ef6a01567d67236bccbb117bb100cf3b2;hp=c47f1dee52fe4fb0109be6e36573742d741bc925;hpb=97a0d17a079a0c963bd5301ee1fc76f2d43cd54c;p=dsa-puppet.git diff --git a/modules/postgres/files/backup_server/postgres-make-base-backups b/modules/postgres/files/backup_server/postgres-make-base-backups index c47f1dee..8b74853c 100755 --- a/modules/postgres/files/backup_server/postgres-make-base-backups +++ b/modules/postgres/files/backup_server/postgres-make-base-backups @@ -39,6 +39,7 @@ if [ -t 0 ]; then verbose=1 else verbose=0 +fi if [ "$verbose" -gt 0 ]; then console="--progress --verbose" @@ -46,15 +47,33 @@ 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 date=$(date "+%Y%m%d-%H%M%S") +thishost=$(hostname -f) while read host port username cluster version; do [ "${host#\#}" = "$host" ] || continue - label="$date-$host-$cluster-$version-backup" + if [ -n "$forcehostport" ] && [ "$forcehostport" != "$host:$port" ]; then + [ "$verbose" -gt 0 ] && echo "Skipping $host:$port $version/$cluster." + continue + fi + + label="$thishost-$date-$host-$cluster-$version-backup" [ "$verbose" -gt 0 ] && echo "Doing $host:$port $version/$cluster: $label" target="$cluster.BASE.$label.tar.gz" @@ -68,10 +87,12 @@ while read host port username cluster version; do fi mv "$tmp" "$ROOTDIR/${host%%.*}/$target" done << EOF -chopin.debian.org 5432 debian-backup dak 9.1 -bmdb1.debian.org 5435 debian-backup main 9.1 -bmdb1.debian.org 5436 debian-backup wanna-build 9.1 -danzi.debian.org 5433 debian-backup main 9.1 -franck.debian.org 5433 debian-backup dak 9.1 -sibelius.debian.org 5433 debian-backup snapshot 9.1 +chopin.debian.org 5432 debian-backup dak 9.4 +bmdb1.debian.org 5435 debian-backup main 9.4 +bmdb1.debian.org 5436 debian-backup wannabuild 9.4 +danzi.debian.org 5433 debian-backup main 9.4 +franck.debian.org 5433 debian-backup dak 9.4 +sibelius.debian.org 5433 debian-backup snapshot 9.4 +moszumanska.debian.org 5432 debian-backup main 9.1 +seger.debian.org 5432 debian-backup dak 9.4 EOF