Skip to content

Instantly share code, notes, and snippets.

@justinlewis
Last active December 12, 2015 06:59
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 justinlewis/4733313 to your computer and use it in GitHub Desktop.
Save justinlewis/4733313 to your computer and use it in GitHub Desktop.
Linux terminal command to backup a PostgreSQL database. Can be executed with a cron job.
PGPASSWORD=your_password pg_dump -i -h your_host -p 5432 -U your_user -F c -b -v -Tc -f /path/to/your/backup.backup your_db_name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment