Created
March 1, 2009 17:50
-
-
Save camwest/72411 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| #upload the file | |
| put(File.read("/tmp/#{dbname}-snapshot.sql.bz2"), "/tmp/#{dbname}-snapshot.sql.bz2", :mode => 0666) | |
| #import the database | |
| run "bzcat /tmp/#{dbname}-snapshot.sql.bz2 | mysql -u #{dbuser} -p #{dbname}" do |ch, stream, out | | |
| ch.send_data "#{dbpass}\n" if out=~ /Enter password:/ | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment