Skip to content

Instantly share code, notes, and snippets.

@ffbit
Created October 15, 2012 14:26
Show Gist options
  • Select an option

  • Save ffbit/3892732 to your computer and use it in GitHub Desktop.

Select an option

Save ffbit/3892732 to your computer and use it in GitHub Desktop.
PostgreSQL dump
#!/bin/bash
DB="dbname"
HOST="127.0.0.1"
UNAME="uname"
pg_dump --host=$HOST --port=5432 --username=$UNAME $DB | gzip -c > $DB.backup.gz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment