Skip to content

Instantly share code, notes, and snippets.

@ZeroICQ
Created February 13, 2022 02:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ZeroICQ/7e319710f3914dd3a1751ca630372492 to your computer and use it in GitHub Desktop.
Save ZeroICQ/7e319710f3914dd3a1751ca630372492 to your computer and use it in GitHub Desktop.
#!/bin/bash
export PGPASSWORD="password"
today=$(date +"%Y%m%d")
pg_dump -vvv -h localhost -p 15432 -U user db_name > dumps/dump_${today}_local.sql
printf "wrote to %s\n" dumps/dump_${today}_local.sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment