1838568 Members
5177 Online
110127 Solutions
New Discussion

Re: wtmp truncated

 
SOLVED
Go to solution
marc seguin
Regular Advisor

wtmp truncated

My file wtmp is truncated every day. It keeps only the logs from 23:20 of the day before up to now.

Inside adm crontab, i can find the line :
20 23 * * * /usr/lib/acct/runacct 2>/usr/adm/acct/nite/fd2log
added by TNG.

Is it a normal action of runacct command ? I want to keep the logs in wtmp for a whole month. How to do this ?

thanks.
2 REPLIES 2
Borislav Perkov
Respected Contributor

Re: wtmp truncated

Hi,
You can do it by changing the cron entry from
20 23 * * * /usr/lib/acct/runacct 2>/usr/adm/acct/nite/fd2log
to
01 00 1 * * /usr/lib/acct/runacct 2>/usr/adm/acct/nite/fd2log
So every 1st of the month at 00:01 you will have executing of the command.

Regards,
Borislav
Fred Ruffet
Honored Contributor
Solution

Re: wtmp truncated

Yes it's a normal behaviour, and, as said, you only have to change your cron to run it every month.

If you want to always have 1 month in wtmp (and not empty it every month) you can specify the date for the runacct command. See man page.

Regards,

Fred
--

"Reality is just a point of view." (P. K. D.)