Skip to content

Commit

Permalink
Fixed wrong container name index
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderwolz committed Apr 25, 2023
1 parent 981a71e commit 1f0594e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bin/backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ function createPostgresBackups() {
local BACKUP_ROOT=$1

if [ -z "$POSTGRES_SERVERS" ]; then
POSTGRES_SERVERS=($(docker ps -a | grep postgres | awk '{ print $11 }'))
POSTGRES_SERVERS=($(docker ps --format "{{.ID}} {{.Image}} {{.Names}}" | grep -h "postgres" | awk '{ print $3 }'))
else
IFS=', ' read -r -a POSTGRES_SERVERS <<< "$POSTGRES_SERVERS"
fi
Expand Down Expand Up @@ -118,7 +118,7 @@ function createMySqlBackups() {
local BACKUP_ROOT=$1

if [ -z "$MYSQL_SERVERS" ]; then
MYSQL_SERVERS=($(docker ps -a | grep -h "mariadb\|mysql" | awk '{ print $12 }'))
MYSQL_SERVERS=($(docker ps --format "{{.ID}} {{.Image}} {{.Names}}" | grep -h "mariadb\|mysql" | awk '{ print $3 }'))
else
IFS=', ' read -r -a MYSQL_SERVERS <<< "$MYSQL_SERVERS"
fi
Expand Down

0 comments on commit 1f0594e

Please sign in to comment.