<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Marius van Witzenburg &#187; Wrapper</title>
	<atom:link href="http://mariusvw.com/tag/wrapper/feed/" rel="self" type="application/rss+xml" />
	<link>http://mariusvw.com</link>
	<description>We fight for our survival, we fight!</description>
	<lastBuildDate>Tue, 27 Dec 2011 10:35:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>How to get SSH to execute a command in the background on target machine</title>
		<link>http://mariusvw.com/2010/03/16/how-to-get-ssh-to-execute-a-command-in-the-background-on-target-machine/</link>
		<comments>http://mariusvw.com/2010/03/16/how-to-get-ssh-to-execute-a-command-in-the-background-on-target-machine/#comments</comments>
		<pubDate>Tue, 16 Mar 2010 18:41:12 +0000</pubDate>
		<dc:creator>mariusvw</dc:creator>
				<category><![CDATA[BSD / Linux / Unix]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[Background]]></category>
		<category><![CDATA[Bash]]></category>
		<category><![CDATA[Command]]></category>
		<category><![CDATA[Execute]]></category>
		<category><![CDATA[Process]]></category>
		<category><![CDATA[SSH]]></category>
		<category><![CDATA[Wrapper]]></category>

		<guid isPermaLink="false">http://mariusvw.com/?p=1382</guid>
		<description><![CDATA[If you try to accomplish this directly with SSH... I can tell you, this can be hard to get the job done! But the solution is quite simple... Create a wrapper around your command which does the job for you. First prepare your SSH command like: ssh -ax marius@192.168.3.7 &#34;sh /home/marius/ssh-wrapper &#62; /dev/null 2&#62;&#38;1; exit&#34; [...]]]></description>
			<content:encoded><![CDATA[<p>If you try to accomplish this directly with SSH... I can tell you, this can be hard to get the job done!</p>
<p>But the solution is quite simple... Create a wrapper around your command which does the job for you.</p>
<p>First prepare your SSH command like:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ssh</span> <span style="color: #660033;">-ax</span> marius<span style="color: #000000; font-weight: bold;">@</span>192.168.3.7 <span style="color: #ff0000;">&quot;sh /home/marius/ssh-wrapper &gt; /dev/null 2&gt;&amp;1; exit&quot;</span></pre></div></div>

<p>Second is to create the wrapper:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
<span style="color: #c20cb9; font-weight: bold;">sh</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>marius<span style="color: #000000; font-weight: bold;">/</span>run <span style="color: #000000; font-weight: bold;">&amp;</span></pre></div></div>

<p>You don't have to make the files executable since you prefix it with <em>sh</em>.</p>
<p>This works for me on 2 machines without any problems so far.</p>
<p>Good luck! <img src='http://mariusvw.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://mariusvw.com/2010/03/16/how-to-get-ssh-to-execute-a-command-in-the-background-on-target-machine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

