Skip to content

Instantly share code, notes, and snippets.

@happypeter
Created June 27, 2012 12:04
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save happypeter/3003659 to your computer and use it in GitHub Desktop.
Save happypeter/3003659 to your computer and use it in GitHub Desktop.
db backup with git
#!/usr/bin/env bash
ssh linode 'cd local_clone; cd happynewsdb; \
mysqldump --extended-insert=FALSE --complete-insert=TRUE -uroot authlove_development>authlove_development.sql; \
git commit -a -m"i"; \
git push;\
cd ../happyecdb/ ; \
mysqldump --extended-insert=FALSE --complete-insert=TRUE -uroot ec_development>ec_development.sql; \
git commit -a -m"i"; \
git push;\
cd ../happycastsdb/ ; \
mysqldump --extended-insert=FALSE --complete-insert=TRUE -uroot happycasts_production>happycasts_production.sql; \
git commit -a -m"i"; \
git push;\
'
cd happycastsdb/; git pull; cd ../happyecdb/; git pull; cd ../happynewsdb/; git pull;
echo game over!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment