Skip to content

Instantly share code, notes, and snippets.

@Raul-mz
Last active February 27, 2019 15:23
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 Raul-mz/c25ba589371acde1619ee568e9ba14fb to your computer and use it in GitHub Desktop.
Save Raul-mz/c25ba589371acde1619ee568e9ba14fb to your computer and use it in GitHub Desktop.
Automated Backup on Linux (Postgresql)
#!bin/bash
export PGPASSWORD="user1"
FILENAME="/DB/Backup_$(date +%Y%m%d%H%M%S).backup"
pg_dump -U user1 --format custom --verbose --file $FILENAME DB_NAME
unset PGPASSWORD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment