Last active
April 16, 2016 13:20
-
-
Save skyebook/3407646 to your computer and use it in GitHub Desktop.
Backup OpenShift PostgreSQL Database
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 | |
# Backs up the OpenShift PostgreSQL database for this application | |
# by Skye Book <skye.book@gmail.com> | |
NOW="$(date +"%Y-%m-%d")" | |
FILENAME="$OPENSHIFT_DATA_DIR/$OPENSHIFT_APP_NAME.$NOW.backup.sql.gz" | |
pg_dump $OPENSHIFT_APP_NAME | gzip > $FILENAME |
Hi, I forked thinking we can do pull request but just found we can't actually.
I just added a line to clean old backup files (mtime +30 = 30 days old)
does not work if database is on separate gear.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I liked this way of taking backup and not taking the backup of entire app.
Thank you very much for quick 3 lines, really helpful