|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Can't open server log file - too big
Hi,
I have recently discovered that our server logs are taking up nearly all of our server space so we have to do something about it. One of the files is 80MB, 400,000 lines which I have downloaded. Problem is no text editor that I have tried can open it - I wish to delete everything before Oct 2001. ( We use Webalizer for our stats, so I'll save the stats output web page for every month prior to this. ) After that I will try to get log rotation going. Does any one know how I could open this file? Pico can read it off the server, but I can think of no way to select 350,000+ lines of logs to delete - or 50,000 to keep. Many thanks. |
|
#2
|
||||
|
||||
|
I would think ms word can handle such big files.... if not try using php go delete first n lines
BTW, yours was 4000th post in the 'apache' forum, congrats ![]()
__________________
And you know I mean that. |
|
#3
|
|||
|
|||
|
Thanks for the reply Al Capone.
MS Word crashes when I try to open the file. What did you mean by php go delete first n lines ? how and where would I run this? Many Thanks |
|
#4
|
|||
|
|||
|
Show us several lines of your log so we can see your log format. Anyhow, whatever way you are going to do, you first should rotate your log.
|
|
#5
|
|||
|
|||
|
Hi, I got EditPad to open it thanks.
I deleted everything before Nov as we had Incremental Processing running on our stats. |
|
#6
|
|||
|
|||
|
I have a little solution, but only for unix (linux).
1. wc -l access_log this will return number of lines in log file 2. grep -n "Oct/2001" aaa|head -1|awk -F: '{ print $1}' this will return 1st line with "Oct/2001" (format is from Apache access log) 3.calculate a difference between 1st and 2nd value 4. tail -<last value> access_log >part_of_access_log ![]() |
![]() |
| Viewing: Dev Shed Forums > System Administration > Apache Development > Can't open server log file - too big |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|