Return to Snippet

Revision: 17420
at September 24, 2009 17:52 by craig0990


Updated Code
#!/bin/sh
# Refresh the SQL schema file for inclusion within the git commit

# If something fails, exit with status other than 0
set -e

# first, remove our original schema
cd /var/www
rm -f filename.sql

# generate a new schema
mysqldump -u username --password=password database > filename.sql

# Add the schema to the next commit
git add filename.sql

# Exit success
exit 0

Revision: 17419
at September 4, 2009 07:43 by craig0990


Initial Code
#!/bin/sh
# Refresh the SQL schema file for inclusion within the git commit

# If something fails, exit with status other than 0
set -e

# first, remove our original schema
cd /var/www
rm -f schema.sql

# generate a new schema
mysqldump -u micronet --password=u8i9o0p- micronet > schema.sql

# Add the schema to the next commit
git add schema.sql

# Exit success
exit 0

Initial URL

                                

Initial Description

                                

Initial Title
Git Pre-Commit MySQL Dump / Backup

Initial Tags
git

Initial Language
Bash