Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save tomfanning/98ff1f7c16844f632ab839448e06c26c to your computer and use it in GitHub Desktop.
Save tomfanning/98ff1f7c16844f632ab839448e06c26c to your computer and use it in GitHub Desktop.
Postgres backup
set PGUSER=postgres
set PGPASSWORD=xxx
set OUTPUTPATH=e:\myfile.backup
set DB=whatever
set HOST=whatever
pg_dump -h %HOST% -p 5432 -U %PGUSER% -F c -b -v -f %OUTPUTPATH% %DB%
rem TCP port to unblock is 5432
echo "host all all 0.0.0.0/0 md5" >> /etc/postgresql/9.3/main/pg_hba.conf
reload service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment