[nmglug] ftp video file truncate
Andrew Farnsworth
farnsaw at stonedoor.com
Tue Jan 12 11:12:06 PST 2010
On Tue Jan 12 13:46 , Jason Schaefer sent:
<snip>
>> tail -2000 logfile.txt > logfile2.txt; rm -f logfile.txt; mv
>> logfile2.txt logfile.
>
>I have no idea what your trying to do here. Perhaps you could explain
>what it is your trying to achieve?
Looks like he is trying to manage the log file size. He takes the log file and
reduces it to the last 2000 lines.
1) Copy last 2000 lines of logfile.txt to logfile2.txt
2) delete logfile.txt
3) rename (move) logfile2.txt logfile.txt
Note that this presumes that the application that creates logfile.txt is opening
and closing the log file regularly rather than just opening it and leaving it open.
Andy
More information about the nmglug
mailing list