Skip to content

Instantly share code, notes, and snippets.

@skylock
Last active January 16, 2018 08:59
Show Gist options
  • Save skylock/c1309bd55fbe53b3084f73331d50c3bb to your computer and use it in GitHub Desktop.
Save skylock/c1309bd55fbe53b3084f73331d50c3bb to your computer and use it in GitHub Desktop.
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 -U postgres
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment