Created
October 1, 2009 10:53
-
-
Save ceritium/198891 to your computer and use it in GitHub Desktop.
This file contains 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
before "deploy:migrate", 'db:backup' | |
namespace :db do | |
desc "Crea un backup de la base de datos antes de correr migraciones" | |
task :backup do | |
run "mkdir -p #{current_path}/db/backups" | |
run "mysqldump -u root -p #{application}_production | gzip > #{current_path}/db/backups/#{application}_production_#{Time.now.strftime '%Y%m%dT%:%H%M%S'}.gzip" do |ch, stream, out| | |
ch.send_data "the password" if out == "Enter password: " | |
end | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment