Skip to content

Instantly share code, notes, and snippets.

@romfrolov
Last active April 13, 2019 07:38
Show Gist options
  • Save romfrolov/75773aff1c2878d60c48078bfc77b741 to your computer and use it in GitHub Desktop.
Save romfrolov/75773aff1c2878d60c48078bfc77b741 to your computer and use it in GitHub Desktop.
Postgres backup.
# backup your databases
docker exec -t your-db-container pg_dumpall -c -U postgres > dump_`date +%d-%m-%Y"_"%H_%M_%S`.sql
# restore your databases
cat your_dump.sql | docker exec -i your-db-container psql -U postgres
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment