Quantcast
Channel: linuxadmin: Expanding Linux SysAdmin knowledge
Viewing all articles
Browse latest Browse all 17880

Need to delete large portion of a MASSIVE log file for a client

$
0
0

A client has a server that is very, very low on drive space and the culprits are two massive log files (at least 50,000,000 each).

I have two headaches here. First, this is a probably 16 year old sun server. uname -a output:

SunOS loghost 5.8 Generic_117350-25 sun4u sparc SUNW,Ultra-80 

Second, the drive in question is at 98% usage.

Normally, I would copy the second half of the file to another file and then remove the original file.

I realize they are going to need to implement some form of log rotation. This is normally something their internal IT guy would handle but he is unavailable due to medical situation. They don't want me to bother with that, just delete the old unneeded data.

Is there a way, on such an old system, to use sed to delete the first half of each of those files without replicating the entire file (no space to do so)?

Edit: Half isn't really necessary. Specifically, the client wants to retain data written since July 1.

submitted by chron67
[link][6 comments]

Viewing all articles
Browse latest Browse all 17880

Trending Articles