[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Commands Reference, Volume 6

wtmpfix Command

Purpose

Manipulates connect-time accounting records by correcting date and time stamp inconsistencies.

Syntax

/usr/sbin/acct/wtmpfixFile ... ]

Description

The wtmpfix command is called by the runacct procedure to examine standard input or Files that contain records in wtmp format, and correct problems that could make the acctcon1 or acctcon2 commands fail. The wtmpfix command corrects date and time stamp inconsistencies, and writes the corrected records to standard output. If the date and time stamps are not consistent when the acctcon1 command runs, the acctcon1 command generates an error and stops.

The wtmpfix command also checks the validity of the name field to ensure that it consists only of alphanumeric characters, a $ (dollar sign), or spaces. If the name is invalid, the wtmpfix command changes the login name to INVALID and writes a diagnostic message to standard error. In this way, the wtmpfix command reduces the chance that the acctcon2 command will fail.

Each time the date is set (on system startup or with the date command), a pair of date change records is written to the /var/adm/wtmp file. The first record is the old date, denoted by the old time string. The old time string is placed in the line field and the OLD_TIME flag is placed in the type field. The second record is the new date, denoted by the string new time. The new time string is placed in the line field and the NEW_TIME flag is placed in the type field. The wtmpfix command uses these records to synchronize all date and time stamps in the file.

Flags

None.

Parameters

File Specifies the file to examine that contains records in wtmp format.

Security

Access Control: These commands should grant execute (x) access only to members of the adm group.

Examples

  1. To convert a binary record in wtmp format to an ASCII record called dummy.file, enter:

    /usr/sbin/acct/fwtmp < /var/adm/wtmp > dummy.file

    The content of a binary wtmp file is redirected to a dummy ASCII file.

  2. To convert an ASCII dummy.file to a binary file in wtmp format called /var/adm/wtmp, enter the fwtmp command with the -ic switch:
    /usr/sbin/acct/fwtmp -ic < dummy.file  > /var/adm/wtmp
    The dummy ASCII file is redirected to a binary wtmp file.

Files

/usr/sbin/acct/wtmpfix Contains the wtmpfix command.
/var/adm/wtmp Contains records of date changes that include an old date and a new date.
/usr/include/utmp.h Contains history records that include a reason, date, and time.

Related Information

The acctcon1 or acctcon2 command, acctmerg command, acctwtmp command, fwtmp command, runacct command.

Setting Up an Accounting System in AIX 5L Version 5.2 System Management Guide: Operating System and Devices describes the steps you must take to establish an accounting system.

See the Accounting Overview in AIX 5L Version 5.2 System Management Concepts: Operating System and Devices for a list of accounting commands that can be run automatically or entered from the keyboard and about the preparation of daily and monthly reports, and the accounting files.

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]