Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Backup OpenShift PostgreSQL Database
#!/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
@harit-sunrun

This comment has been minimized.

Show comment
Hide comment
@harit-sunrun

harit-sunrun May 11, 2013

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

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

@shaiton

This comment has been minimized.

Show comment
Hide comment
@shaiton

shaiton Oct 23, 2014

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)

shaiton commented Oct 23, 2014

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)

@lucas03

This comment has been minimized.

Show comment
Hide comment
@lucas03

lucas03 Aug 4, 2015

does not work if database is on separate gear.

lucas03 commented Aug 4, 2015

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