Skip to content

Instantly share code, notes, and snippets.

@hasanisaeed
Created April 3, 2023 12:03
Show Gist options
  • Save hasanisaeed/8c9005ff31faa6953cf7630ca7529ff1 to your computer and use it in GitHub Desktop.
Save hasanisaeed/8c9005ff31faa6953cf7630ca7529ff1 to your computer and use it in GitHub Desktop.
POSTGRES_DB=
pg_dump $POSTGRES_DB -U postgres | gzip > $POSTGRES_DB-$(date +%d-%m-%y_%H-%M).tar.gz
gunzip -c filename.gz | psql -U u -d db
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment