Skip to content

Instantly share code, notes, and snippets.

@mbenedettini
Last active May 20, 2018 23:57
Show Gist options
  • Save mbenedettini/9e2888353a5b06946a48c793fda0aa7e to your computer and use it in GitHub Desktop.
Save mbenedettini/9e2888353a5b06946a48c793fda0aa7e to your computer and use it in GitHub Desktop.
Postgresql docker backup custom format
# Backups database $DATABASE running in container $CONTAINER
docker exec -u postgres $(docker ps | grep $CONTAINER | cut -f 1 -d " ") pg_dump -Fc $DATABASE > "$OUTPUTDIR/$DATABASE-$(date "+%u").pg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment