title: Need suggestion to move a big live file in linux
body: <p>Multiple scripts are running in my Linux server which are generating huge data and I realise that it will eat all my 500GB of storage size in next 2-5 days and scripts require 10 more days to finish the process means they need more space. So most likely I am going to have a space issue problem and I will have to restart the entire process again.
  Process is like this -
  <code>script1.sh</code> content is like below</p>
  <pre><code>&quot;calling an api&quot; &gt; /tmp/output1.txt
  </code></pre>
  <p>script2.sh content is like below</p>
  <pre><code>&quot;calling an api&quot; &gt; /tmp/output2.txt
  </code></pre>
  <p>Executed like this -</p>
  <pre><code>nohup ./script1.sh &amp; ### this create file in  /tmp/output1.txt 
  nohup ./script2.sh &amp; ### this create file in  /tmp/output2.txt 
  </code></pre>
  <p>My understand initially was, if I will follow below steps, it should work --
  when scripts are running with nohup in background execute this command -</p>
  <pre><code>mv /tmp/output1.txt /tmp/output1.txt_bkp; touch /tmp/output1.txt 
  </code></pre>
  <p>And then transfer this file <code>/tmp/output1.txt_bkp</code> to another server via ftp and remove it after that to get space on server and script will keep on writing in <code>/tmp/output1.txt</code> file.</p>
  <p>But this assumption was wrong and script is keep on writing in <code>/tmp/output1.txt_bkp</code> file. I think script is writing based on inode number that is why it is keep on writing in old file.</p>
  <p>Now the question is how to avoid space issue without killing/restart scripts?</p>