<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On 13 Aug 2012, at 23:57, Michael Truog wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">
<meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type">
<div bgcolor="#ffffff" text="#000000">
On 08/13/2012 02:54 PM, Thomas Elsgaard wrote:
<blockquote cite="mid:CAKSYKuLFB=HOS-gAttzkALMVQ7XYcuVH4gy6QUqAN-xg_JFusQ@mail.gmail.com" type="cite">
<pre wrap="">Hi
Does anybody have a good simple example of executing commands on a
remote server via SSH?
Nothing fancy, just something like:
------
Connect to host
Execute command '/bin/ls'
Read output from command
Close connection
------
</pre>
</blockquote>
Just do:<br>
<pre wrap=""><code>slave:start_link('nodename', 'user', "-rsh ssh").
</code></pre></div></blockquote><div><br></div><div>That works a treat if the node has Erlang installed under the same file system layout and one of two other constraints. If that isn't the case it fails. There is an ssh application with which you could wrap this up of course, and iirc a couple of people on github have started to put together projects to address this kind of thing, though I've no idea how complete or stable they are, nor indeed what the projects are called.</div><div><br></div><div>Slave module works well if the constraints don't bother you though - I use it a lot.</div></div></body></html>