Last active
April 22, 2021 03:25
-
-
Save mpelos/6cc9287bea5f24ba07da043630617970 to your computer and use it in GitHub Desktop.
Postgres docker container backup script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
filename=$(date +"%Y%m%d%H%M%S").out | |
dirname=$(date +"%Y-%m") | |
/usr/bin/docker exec postgres /usr/bin/pg_dumpall -U postgres > /tmp/$filename | |
gsutil cp /tmp/$filename gs://ebb-prod-postgres-backups/$dirname/$filename | |
rm -f /tmp/$filename |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment