note
idnopheq
Is there a specific reason you want to edit/truncate it in place? Seems like it maybe a lot of work and risky at that. It may be easier to simply rotate the log throughout the day, compressing the older ones to save space. Have you checked out [id://69532]? Are these files flat text, or something else? A search on google may be a good idea. I seem to run across log rotation scripts every few weeks.
<p>
<b>NON-perl</b>: I recall in *nix copying the whole file into a new one (filename.0), then something like echo /dev/null > <i>filename</i>. Finally, I'd gzip or bzip2 the logfile.0. YMMV.
<p>
HTH
<br>
--
<br>
<A HREF="/index.pl?node_id=63535&lastnode_id=1072">idnopheq</a>
<br>
<small><i>
Apply yourself to new problems without preparation, develop confidence in your ability to to meet situations as they arrise.
</i></small>
<ul><small>
~ <A HREF="http://www1.fatbrain.com/asp/BookInfo/BookInfo.asp?theisbn=0767901053&from=MDZ411">Shunryu Suzuki</A>
</small></ul>
106904
106904