The task that I have now is for a database backup...

    task :backup, :roles => :db, :only => { :primary => true } do
         filename =
"#{stage}.#{application}.dump.#{Time.now.to_i}.sql.bz2"
         file = "/tmp/#{filename}"
         on_rollback { run "rm #{file}"; true }
         run "mysqldump -u root #{application}_#{stage} | bzip2 -c >
#{file}"  do |ch, stream, data|
             puts data
         end
         `mkdir -p #{File.dirname(__FILE__)}/../backups/`
         `rsync [EMAIL PROTECTED]:db][0].host}:#{file}
#{File.dirname(__FILE__)}/../backups/`
     end

But I need the port number and I thought the role would be a great
place to put that.

Is there a current.role.get.port or current.task.role? I'm not the
best ruby programmer (just started with Ruby and Capistrano) so if you
have an example that would help greatly..

I see this as something we would use for qa where we have multiple
databases running on one server with different ports.

Sorry about the newbee questions.




--~--~---------~--~----~------------~-------~--~----~
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/capistrano
-~----------~----~----~----~------~----~------~--~---

Reply via email to