1832804 Members
3166 Online
110045 Solutions
New Discussion

Log Trim on 10.20

 
Bill Pontius
Frequent Advisor

Log Trim on 10.20

I have the following bootp and info logs that I'd like to trim. There are active DHCP files. I've added these logs to other logs using SAM and have tried various ways of trimming but none have worked. Usually it will show 0 bytes or a trimmed amount but when I do the ll or check SAM, it is back to the same growing size. I guess the worse case is to bring DHCP down, trim with SAM or echo > to logs and restore DHCP.


/opt/CSCOcddm/log $ ll
total 1590
-rw-rw-r-- 1 root sys 169 Jul 20 16:15 .masterserver.log
-r-------- 1 root root 4 Jul 20 14:58 .netcntrl.pid
-rw-r--r-- 1 root root 180 Sep 28 1999 alan.log
-rw-rw-r-- 1 root sys 70890299 Jul 26 14:10 bootp.log
-rw-rw-r-- 1 root sys 16325 Jul 26 12:48 bootp.logSAMTRM
-rw-rw-r-- 1 root sys 62669 Jul 26 13:38 errors.log
-rw-rw-r-- 1 root sys 30419 Jul 23 08:27 errors.logSAMTRM
-rw-rw-r-- 1 root sys 70827726 Jul 26 14:10 info.log
-rw-rw-r-- 1 root sys 11577 Jul 26 12:49 info.logSAMTRM
-rw-rw-rw- 1 root sys 184320 Jul 20 13:11 logtar
so let it be wriiten so let it be done
3 REPLIES 3
John Poff
Honored Contributor

Re: Log Trim on 10.20

Hello,

Have you tried this?:

>bootp.log

That should zero out the file, even if a process is holding it open.

JP
Joseph C. Denman
Honored Contributor

Re: Log Trim on 10.20

Could you not just save them off and zip them?

for x in `ls *log*`
do
cp $x $x.bak
/usr/contrib/bin/gzip $x.bak
cp /dev/null $x
done

...jcd...
If I had only read the instructions first??
John Poff
Honored Contributor

Re: Log Trim on 10.20