SHARE
TWEET

Untitled

a guest Feb 4th, 2012 244 Never
  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
RAW Paste Data
Top