[ Previous | Next | Contents | Glossary | Home | Search ]
AIX Version 4.3 Commands Reference, Volume 2

diskusg Command

Purpose

Generates disk accounting data by user ID.

Syntax

diskusg [ -U MaxUsers ] [ -i FileListName ] [ -p File ] [ -u File ] [ -v ] { -s File ... ] | FileSystem ... }

Description

The diskusg command generates intermediate disk-accounting information from data in the files specified with the File or FileSystem parameters or from standard input. The diskusg command writes one record per user to standard output. This command is called by the dodisk command, which can be run under the cron daemon. The output is in the following format:

UID Contains the numerical user ID of the user.
Login Contains the login name of the user.
Blocks Contains the total number of 512-byte disk blocks allocated to the user.

The output of this command becomes the input of the acctdisk command, which converts the information to a total accounting record. The total accounting record is merged with other total accounting records to produce the daily report.

If you specify the FileSystem parameter, the diskusg command reads the i-nodes of the specified file systems to generate the usage data. The FileSystem parameters must be the special file names of the file system devices. For example, use the /dev/hd4 device instead of / (root) directory to generate usage data for the root file system.

If you specify the File parameter, the input must be in a diskusg output format.

For more information on disk usage, see the acctdusg command.

Note: This command is for local devices only.

Flags

-i FileListName Ignores the data in the FileListName file system. The FileListName variable specifies a list of file system names separated by commas or enclosed within quotation marks.
-p File Uses the password file specified by the File variable to generate login names. The default is the /etc/passwd file.
-s [File] Combines all records from the input file(s) or from standard input into a single record. The input data is already in a diskusg output format.
-U MaxUsers Sets the maximum number of users that can be processed by the diskusg command. You need to use this flag only if the number of users is greater than the default of 5000.
-u File Writes a record to the specified File variable for each file that is charged to a user ID of no one. Each record consists of the special file name, the i-node number, and the user ID.
-v Writes a list of all files that are charged to no one to the standard error output.

Security

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

Examples

To generate daily disk-accounting information, add a line similar to the following to the /var/spool/cron/crontab/root file:

0 2 * * 4 /usr/sbin/acct/dodisk

This command tells the cron daemon to run the dodisk command at 2 a.m. (02) each Thursday (4). The dodisk command calls both the diskusg and acctdisk commands.

Note: To perform this example, you must have root authority.

Files

/usr/sbin/acct/diskusg Contains the diskusg command.
/etc/passwd Contains the basic attributes of users.

Related Information

The acctdisk command, acctmerg command, dodisk command, runacct command.

The acct subroutine.

The acct file format and utmp file format.

Accounting Commands, Accounting Overview, Setting Up an Accounting System in AIX Version 4.3 System Management Guide: Operating System and Devices


[ Previous | Next | Contents | Glossary | Home | Search ]