Created
December 3, 2010 10:08
-
-
Save mrtazz/726788 to your computer and use it in GitHub Desktop.
dump the redmine DB from psql and commit it to a git repository
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/sh | |
# | |
# shell script to dump a database from PostgreSQL and | |
# store it in git | |
# | |
AUTHOR="User <user@host>" | |
GITCMD="/usr/local/bin/git" | |
DUMPCMD="/usr/local/bin/pg_dump" | |
BACKUP_REPO="/path/to/repo" | |
DUMPFILE="redmine.sql" | |
DB="NAME_OF_YOUR_REDMINE_DB" | |
# dump, commit and push | |
${DUMPCMD} ${DB} > ${BACKUP_REPO}${DUMPFILE} | |
cd ${BACKUP_REPO} | |
${GITCMD} add ${DUMPFILE} | |
${GITCMD} commit -q --author "${AUTHOR}" -m "update redmine dump" | |
${GITCMD} push -q origin master |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment