1832542 Members
5681 Online
110043 Solutions
New Discussion

sulog question

 
SOLVED
Go to solution
Nick Lewers
Advisor

sulog question

It appears as if the sulog is cleared on system start. Is there a way to not clear that file on startup? Also, what is the best way to clear wtmp/btmp to keep say the last year of entries?
4 REPLIES 4
James R. Ferguson
Acclaimed Contributor
Solution

Re: sulog question

Hi Nick:

The 'sulog' is moved to 'OLDsulog' during startup.

As for 'wtmp' and/or 'btmp', transform these into an Ascii text file:

# /usr/sbin/acct/fwtmp < /var/adm/wtmp > /tmp/wtmp

Now, either retain this version, or edit the contents and re-create a modified parent:

# /usr/sbin/acct/fwtmp -ic < /tmp/wtmp > /var/adm/wtmp

Regards!

...JRF...


Pete Randall
Outstanding Contributor

Re: sulog question

As James points out, the sulog is renamed during startup. The script that does this is /sbin/init.d/clean_adm. You could easily modify this to do whatever you desire.


Pete

Pete
Court Campbell
Honored Contributor

Re: sulog question

As mentioned the file is just moved. If you want to disable the move you can edit the script /sbin/init.d/clean_adm, or you could disable the script from running in /etc/rc.config.d/clean. But I will leave the decision to you. In my case I turned it off because I have a perl script that does the log rotation.
"The difference between me and you? I will read the man page." and "Respect the hat." and "You could just do a search on ITRC, you don't need to start a thread on a topic that's been answered 100 times already." Oh, and "What. no points???"
Nick Lewers
Advisor

Re: sulog question

thanks for the quick replies, will probably just disable it from being cleaned out as I was told to keep it in perpetuity.

the wtmp/btmp information is also quite helpful.