Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Feb 4th, 2012  |  syntax: Ruby  |  size: 0.34 KB  |  views: 225  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. namespace(:deploy) do
  2.         task :mysqldump, :roles => :app do
  3.                 text = capture "cat #{shared_path}/database.yml"
  4.                 yaml = YAML::load(text)
  5.                 run "mysqldump --opt #{yaml['mysql']['database']} -h #{yaml['mysql']['host']} -u #{yaml['mysql']['username']} -p#{yaml['mysql']['password']} | gzip > #{shared_path}/backups/#{Time.now.to_i}.sql.gz"
  6.         end
  7. end
clone this paste RAW Paste Data