1827294 Members
1366 Online
109960 Solutions
New Discussion

sulog entries

 
dhanish
Regular Advisor

sulog entries

I have a question if i reboot my system then sulog ,wtmp,btmp entries will remain there or they will be flused.
Never Say Die
7 REPLIES 7
James R. Ferguson
Acclaimed Contributor

Re: sulog entries

Hi:

Unless you trim logs like these, they will grow endlessly. To empty them, do this:

# cat /dev/null > /var/adm/wtmp

etc. or if you prefer shorthand:

# > /var/adm/wtmp

...JRF...

Rob Smith
Respected Contributor

Re: sulog entries

Hi, or you can write a little script to empty those log files when they reach a certain size.

#!/usr/bin/sh

VAL=`/usr/bin/ll /var/adm/wtmp | awk '{print $5}'`

if [[ $VAL -gt 1000000 ]]
then

cat /dev/null > /var/adm/wtmp

fi


exit

Hope this helps.

Rob



Learn the rules so you can break them properly.
Jim Turner
HPE Pro

Re: sulog entries

Before you zero-out the files, you might consider archiving them somewhere. You may encounter a situation where you need to investigate login's or su's.

Cheers,
Jim
Bruce Regittko_1
Esteemed Contributor

Re: sulog entries

Hi,

No those and most other log files are not flushed at reboot - they should still be there - unless someone wrote (or modified) a startup/shutdown script.

--Bruce
www.stratech.com/training
dhanish
Regular Advisor

Re: sulog entries

Thanks to all of you.
Never Say Die
Paula J Frazer-Campbell
Honored Contributor

Re: sulog entries

Hi

SAM has a log trimming facility:-

Sam
Routine tasks
System log files


Paula
If you can spell SysAdmin then you is one - anon
Shahul
Esteemed Contributor

Re: sulog entries


Hi Nitin

Once U reboot ur sulog will be flushed off. But wtmp and btmp will remain same.


Shahul