Forked from gilyes/Backup, restore postgres in docker container
Created
July 15, 2019 07:11
-
-
Save vantrong291/26c5e280a9834f57a28fc6d86a830bfd to your computer and use it in GitHub Desktop.
Backup/restore postgres in docker container
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Backup: | |
| docker exec -t -u postgres your-db-container pg_dumpall -c > dump_`date +%d-%m-%Y"_"%H_%M_%S`.sql | |
| Restore: | |
| cat your_dump.sql | docker exec -i your-db-container psql -Upostgres |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment