I would like to do the same as with Capistrano2
task :memory do
run "free | awk '/^Mem:/{print $4}'" do | channel, stream, data |
puts "host: #{channel[:host]} has free memory of #{data.to_i/1024} MB"
end
end
Using capture does not help, since it only prints after the remote command completes.
source
share