X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;ds=sidebyside;f=modules%2Fpostgres%2Ffiles%2Fbackup_server%2Fpostgres-make-base-backups;h=83567270817ae369b580d5b0d232ee7313d7e8a5;hb=57e5c2cd777ea92b73118a4e19416ab436983cd7;hp=9a9d188037521bdfdf6f28e9fd2a77694b68fc16;hpb=a974fb3b83dc4db55ecc5795f38e12d1e29fb546;p=mirror%2Fdsa-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 9a9d18803..835672708 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" @@ -69,10 +86,11 @@ 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 +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.1 -franck.debian.org 5433 debian-backup dak 9.1 +franck.debian.org 5433 debian-backup dak 9.4 sibelius.debian.org 5433 debian-backup snapshot 9.1 +moszumanska.debian.org 5432 debian-backup main 9.1 EOF