encode backuphost in label for basebackups
authorPeter Palfrader <peter@palfrader.org>
Thu, 8 Oct 2015 12:05:29 +0000 (14:05 +0200)
committerPeter Palfrader <peter@palfrader.org>
Thu, 8 Oct 2015 12:10:07 +0000 (14:10 +0200)
modules/postgres/files/backup_server/postgres-make-base-backups

index 91b5e2c..691b13a 100755 (executable)
@@ -63,6 +63,7 @@ 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
@@ -72,7 +73,7 @@ while read host port username  cluster version; do
                continue
        fi
 
-       label="$date-$host-$cluster-$version-backup"
+       label="$thishost-$date-$host-$cluster-$version-backup"
        [ "$verbose" -gt 0 ] && echo "Doing $host:$port $version/$cluster: $label"
 
        target="$cluster.BASE.$label.tar.gz"