Created
May 24, 2012 20:07
-
-
Save kmatt/2783910 to your computer and use it in GitHub Desktop.
Monitoring dump and restore with pv
This file contains 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
# dump | |
pg_dump testdb | pv -c -s $(psql -tc "SELECT pg_database_size('testdb')") -N dump | gzip > testdb.sql.gz | |
# restore | |
pv testdb_20120501.sql.gz | zcat | psql testdb |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Cool solution :)
Also, interactive password input will not work, so you need to pass it through.
Something like (running postgres from container):