Installation guide
During system operation, date changes and reboots occur, and the records
are written to the /var/adm/wtmp file. The wtmpfix command adjusts the
time stamps in the /var/adm/wtmp file; however, some corrections can
evade detection by the wtmpfix command and cause the acctcon
command to fail. In this case, you can correct the /var/adm/wtmp file by
using the fwtmp command.
The fwtmp command has the following syntax:
/usr/sbin/acct/fwtmp
[-ic]
The fwtmp file uses standard input, or you can direct a file to the command.
If no options are specified with the fwtmp command, binary records are
converted to ASCII records. Refer to the fwtmp
(8) reference page for
information on command options.
If you want to enter /usr/include/utmp.h header file records manually,
you must enter data in each of the nine fields in the order used by the
utmp ASCII structure members, as shown in Table 12–6. All record-field
entries that you enter from the keyboard must be separated by a space.
Also, you must specify all the string fields by using blank characters, if
necessary, up to the maximum string size. All decimal values must be
specified with the required number of decimal places, using preceding 0s
(zeros) to indicate the empty digit positions.
The following example converts the /var/adm/wtmp binary file records to
ASCII records:
# /usr/sbin/acct/fwtmp < /var/adm/wtmp
system boot 0 20000 0000 652547412 Jan 5 11:10:12 1994
system boot 0 10062 0123 652547412 Jan 5 11:10:12 1994
bcheck bl 6 80000 0000 652547413 Jan 5 11:10:13 1994
cat cr 16 80000 0000 652547414 Jan 5 11:10:14 1994
rc rc 17 80000 0000 652547485 Jan 5 11:11:25 1994
hoffman co console 147 70000 0001 652547495 Jan 5 11:11:35 1994
hoffman p4 pty/ttyp4 2156 80000 0002 652650095 Jan 6 15:41:35 1994
LOGIN p4 pty/ttyp4 2140 60000 0000 652649075 Jan 6 15:24:35 1994
LOGIN p4 pty/ttyp4 2140 80000 0000 652649086 Jan 6 15:24:46 1994
To correct a /var/adm/wtmp file:
1. Change your working directory to /var/adm/acct/nite.
2. Use the fwtmp command to create an ASCII version of the wtmp file.
# fwtmp < wtmp.0617 > wtmp_temp
3. Edit the temporary file and remove the corrupted records.
4. Use the fwtmp command to re-create the wtmp file.
# fwtmp −ic < wtmp_temp > wtmp.0617
12–16 Administering the System Accounting Services