Skip to content

Instantly share code, notes, and snippets.

@happypeter
Created September 24, 2012 10:22
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save happypeter/3775346 to your computer and use it in GitHub Desktop.
Save happypeter/3775346 to your computer and use it in GitHub Desktop.
db backup with git
#!/usr/bin/env bash
ssh linode 'cd local_clone/db-data/; \
mysqldump --extended-insert=FALSE --complete-insert=TRUE -uroot authlove_production>authlove_production.sql; \
mysqldump --extended-insert=FALSE --complete-insert=TRUE -uroot ec_development>ec_development.sql; \
mysqldump --extended-insert=FALSE --complete-insert=TRUE -uroot happycasts_production>happycasts_production.sql; \
git add *.sql
git commit -a -m"i"; \
git push;\
'
cd ~/repo-farm/db-data/ && git pull
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment