PGPASSWORD

This commit is contained in:
julien 2025-01-19 16:31:52 +01:00
parent af6944e96d
commit 122549f077

View File

@ -26,7 +26,7 @@ if [ -d "volumes/postgres" ]; then
DB_PASSWORD=$(nerdctl exec $CONTAINER_NAME bash -c 'echo "$POSTGRES_PASSWORD"') DB_PASSWORD=$(nerdctl exec $CONTAINER_NAME bash -c 'echo "$POSTGRES_PASSWORD"')
DB_NAME=$(nerdctl exec $CONTAINER_NAME bash -c 'echo "$POSTGRES_DATABASE"') DB_NAME=$(nerdctl exec $CONTAINER_NAME bash -c 'echo "$POSTGRES_DATABASE"')
DUMP_NAME=$CONTAINER_NAME.sql DUMP_NAME=$CONTAINER_NAME.sql
nerdctl exec -e $CONTAINER_NAME pg_dump -U $DB_USER $DB_NAME > volumes/$DUMP_NAME nerdctl exec -e PGPASSWORD=$DB_PASSWORD $CONTAINER_NAME pg_dump -U $DB_USER $DB_NAME > volumes/$DUMP_NAME
fi fi
# Compress all volumes excerpt mysql and postgres # Compress all volumes excerpt mysql and postgres