title: Unix shell script to truncate a large file
body: <p>I am trying to write a Unix script which will truncate/empty a file which is continuously being written/open by an application when it reaches say 3GB of space. I know that the below command would do it : </p>
  
  <pre><code>cp /dev/null [filename]
  </code></pre>
  
  <p>But I am going to run this in an production environment automatically as a cron job - just posting here to see if you guys faced any issues while doing something similar to this. </p>