Skip to content

Instantly share code, notes, and snippets.

@raicerk
Created April 25, 2020 00:11
Show Gist options
  • Save raicerk/a9965be88738552f3162315f4519dfaa to your computer and use it in GitHub Desktop.
Save raicerk/a9965be88738552f3162315f4519dfaa to your computer and use it in GitHub Desktop.
//Ejecutar respaldo
docker exec -t your-db-container pg_dumpall -c -U postgres > dump_`date +%d-%m-%Y"_"%H_%M_%S`.sql
//Ejecutar restauracion
cat your_dump.sql | docker exec -i your-db-container psql -U postgres -d nombredb
//-U corresponde al usuario de la base de datos
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment