title: Run a particular ssh command in background for 24/7 on VPS server
body: <p>I have a VPS server with Bluehost(fedora OS), I wanted to capture data from remote application via <code>TCP</code> and to write the same onto a file for further processing. So I am using <code>netcat</code> for that. </p>
  
  <pre><code> nc -l -k -v IP_ADDRESS_HERE 5331 &gt; /home/user/public_html/tcp/data.xml
  </code></pre>
  
  <p>by using above command in <code>ssh</code>, the <code>Netcat</code> listens to a particular port and writes a captured data on to a file called <code>data.xml</code>.</p>
  
  <p><strong>The Problem:</strong> I want this command to run continuously even after closing ssh terminal, and even after server is restarted. I used to <code>screen</code> and <code>nohup</code>. These options not going to be the solution as it won't run if the server is restarted.</p>
  
  <p>How do i do that? using some scripts?, I am bit new to this field, please help me. </p>
  
  <p>Thanks in advance :)</p>
  
  <p><strong>Update:</strong> Even in ssh terminal, above command works perfect but automatically ends with <code>^C</code> after some time. please help me.</p>