Forum Moderators: DixonJones

Message Too Old, No Replies

HUGE log file....

My log file is so big...

         

Kmax

3:27 am on Mar 13, 2002 (gmt 0)

10+ Year Member



that i cannot open it...
I tried several programs that people said should open big stuff like that...
But none of that worked....
Does anyknow how I may be able to just delete the log file and start over?
I am using a cobalt raq server.
I tried to delete it but it is so big that it times out...
I would appreciate any tips you can give.

Macguru

3:58 am on Mar 13, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



According to my little experience nothing beats BBEdit on Mac and Word on PC.

Other sugestions where given in this thread [webmasterworld.com].

Sorry I can't help with deleting the old logfile. Some scripting professional might help here.

bird

4:11 am on Mar 13, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Most text editors will reach their limits if the data gets bigger than the total amount of RAM in the system, or earlier if ther's a per-process limit configured on the system.
Do you dare to tell us the actual size? ;)

Do you have shell access on the Raq?

To create several smaller files from a large one, use this command:

split -5000 <file> <prefix>

where <file> is the name of your original file.
This will create a number of files with names like this:

<prefix>aa
<prefix>ab
<prefix>ac
...

So, if you use "new-" as <prefix>, then the files will be named "new-aa", "new-ab", etc.
Each of those files will contain 5000 lines of the original file, or any other number, if you change the first parameter accordingly. With the standard extended log file format, 5000 lines take approximately one megabyte. If you have an idea about the largest file size you can handle, then it may be practical to increase the size to that limit, so that you'll get fewer files.

I have a hard time imagining that deleting the file runs into a timeout. Are you sure the removal failed, or did it finish while your login was cut off?
If all else fails, you can try this:

echo "" ¦ cat > <file>

The first ">" is a literal "larger than" character, and <file> is again your file name. This will write an EOF at the beginning of the file, reducing its size to zero. After that, removing it shouldn't be a problem.

Kmax

4:17 am on Mar 13, 2002 (gmt 0)

10+ Year Member



wow. thanks.
i dont remember the size right now.. but it is huge...

yes i have access to everything on the server.

where do I type in those commands? in telnet or something?

we have a gui to administer the server from...

bird

1:38 pm on Mar 13, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes, telnet gives you a shell to type in those commands.
I assume that the Raq runs a fairly standard Linux setup, so they should be available.

If you need to get down and dirty, any GUI is useless.

andron

2:00 pm on Mar 13, 2002 (gmt 0)

10+ Year Member



you can tail the file as well (this does not split it but makes it possable to read the file as it's being generated.)

>tail [filename]

set up your webserver to begin a new log every day.