Fixing Accounting errors

You can correct date and time-stamp inconsistencies.

You must have root user or adm group authority to perform this procedure.

Processing the /var/adm/wtmp file might produce some warnings mailed to root. The wtmp file contains information collected by /etc/init and /bin/login and is used by accounting scripts primarily for calculating connect time (the length of time a user is logged in). Unfortunately, date changes confuse the program that processes the wtmp file. As a result, the runacct command sends mail to root and adm complaining of any errors after a date change since the last time accounting was run.

  1. Determine if you received any errors.
    The acctcon1 command outputs error messages that are mailed to adm and root by the runacct command.
    For example, if the acctcon1 command stumbles after a date change and fails to collect connect times, adm might get mail like the following mail message:
    Mon Jan 6 11:58:40 CST 1992
    acctcon1: bad times: old: Tue Jan 7 00:57:14 1992
    new: Mon Jan 6 11:57:59 1992
    acctcon1: bad times: old: Tue Jan 7 00:57:14 1992
    new: Mon Jan 6 11:57:59 1992
    acctcon1: bad times: old: Tue Jan 7 00:57:14 1992
    new: Mon Jan 6 11:57:59 1992
  2. Adjust the wtmp file by typing:
    /usr/sbin/acct/wtmpfix wtmp
    The wtmpfix command examines the wtmp file for date and time-stamp inconsistencies and corrects problems that could make acctcon1 fail. However, some date changes slip by wtmpfix.
  3. Run accounting right before shutdown or immediately after startup.
    Using the runacct command at these times minimizes the number of entries with bad times. The runacct command continues to send mail to the root and adm accounts, until you edit the runacct script, find the WTMPFIX section, and comment out the line where the file log gets mailed to the root and adm accounts.