Skip to content

Instantly share code, notes, and snippets.

@Ulv
Created February 25, 2014 09:33
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ulv/9205744 to your computer and use it in GitHub Desktop.
Save Ulv/9205744 to your computer and use it in GitHub Desktop.
git pre-commit hook - backup mysql database on every commit
#!/usr/bin/bash
# бэкап mysql базы при каждом коммите
FILENAME=/home/www/intinity/klumbariy/db/`date +%d-%m-%Y-%H-%I-%S`.mysql
mysqldump intinity_klumba -u klumba \
-p2UDRyHqedqnSfFfW > ${FILENAME}
git add $FILENAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment