Created
October 14, 2011 16:40
-
-
Save wildfalcon/1287633 to your computer and use it in GitHub Desktop.
Capistrano backup database
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
desc "Backup and download database" | |
task :backup do | |
filename = "#{Time.now.strftime("%Y-%m-%d-%H-%M")}.sql" | |
run "mysqldump -u #{user} -p#{password} #{application}_prod > /tmp/#{filename}" | |
download "/tmp/#{filename}", "backups/#{filename}" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment