Using ruby ssh to exec a shell process that runs continuously on a remote machine. How can I enforce a duration for the ssh process to run and then have this process killed, and ruby ssh call end, moving on to subsequent code?
Purpose: invoke tests on a remote machine using ruby ssh for a specific duration.
example:
Net::SSH.start( hostname.to_s, username.to_s, :password => pw.to_s ) do|ssh|
output = ssh.exec("command line call that runs continuously")
end
The only things I can think of doing: a) using Terminator to wrap around the ruby exec call for a duration of time b) use a perl helper function around the command line call as shown here
There must be something simpler than this right?