Results 1 to 4 of 4
Hi!
I would like to make a question.
I have a big log that it's increment continuous time.
I would like that the script contents only 1 million of lines. ...
- 05-07-2009 #1Just Joined!
- Join Date
- Oct 2008
- Posts
- 48
clear lines of LOG file
Hi!
I would like to make a question.
I have a big log that it's increment continuous time.
I would like that the script contents only 1 million of lines. (About 250mb)
When I execute: cat jxl.log | wc -l i see the exactly lines, but the question is: How can i make a maintenance to clear the lines increase 1 more line?
- 05-07-2009 #2When I find myself burried in errors, Windows Help appears to me; speaking words of wisdom, Reboot!

- 05-08-2009 #3Just Joined!
- Join Date
- Oct 2008
- Posts
- 48
ok. I explain another time.
I have one log. This log increase continuous and i would like to control the size of this.
I only like to have this log with 250Mb (about 1 million lines)
How it's possible to control this??
- 05-09-2009 #4
Well, there may be several ways, but one could be to have a cron job that checks it's size, and then if it's greater than 250 Mb, remove the first few lines (so you always have the most recent 1 million), then check again - if it's stil to big, remove a few more lines, and so on until it's done. This loop should only take a fraction of a second to run, and should only need to execute every hour at most.
When I find myself burried in errors, Windows Help appears to me; speaking words of wisdom, Reboot!


Reply With Quote
