“Sauvegarde Postgres Database Docker” Réponses codées

Pgrestore Schema Sauvegarde dans un conteneur

docker exec -i pg_container_name psql --username pg_username [--password pg_password] database_name < /path/on/your/machine/dump.sql
Grotesque Gerenuk

Sauvegarde Postgres Database Docker

REM For Windows Systems - Only Schema
for /f %%i in ('powershell -c "get-date -format yyyyMMdd_HHmmss"') do @set DATETIME=%%i
docker exec -t pgdb_container pg_dump --username "your-username" --no-password --verbose --role "root" --format=p --schema-only --create --clean --encoding "UTF8" "your-database-name" > "%~dp0backup_%DATETIME%.sql"

REM For Windows Systems - Full Backup
docker exec -t pgdb_container pg_dump --username "your-username" --no-password --verbose --role "root" --format=p --create --clean --encoding "UTF8" "your-database-name" > "%~dp0backup_%DATETIME%.sql"


REM https://stackoverflow.com/a/48689986/9034699
REM Taken from pgAdmin during backup operation
Muddy Moose

Sauvegarde Postgres Database Docker

docker exec -t your-db-container pg_dumpall -c -U postgres > dump_`date +%d-%m-%Y"_"%H_%M_%S`.sql
Curious Corncrake

Réponses similaires à “Sauvegarde Postgres Database Docker”

Questions similaires à “Sauvegarde Postgres Database Docker”

Plus de réponses similaires à “Sauvegarde Postgres Database Docker” dans Shell/Bash

Parcourir les réponses de code populaires par langue

Parcourir d'autres langages de code