pac Command

Purpose

Prepares printer or plotter accounting records.

Syntax

pac-c] [  -m] [  -pPrice ] [  -PPrinter ] [  -qFile ] [  -r ] [  -s] [ Name ... ]

Description

The pac command prepares printer or plotter accounting records for each user of the selected printer or for the users who are specified by the Name parameter. For printer choices, see the -P flag.

The unit of measure is the number of pages, except for raster devices, for which feet of paper are measured. Output is expressed both as the number of units that are used and the charge in dollars. For information on the charge (price) per unit, see the -p flag.

The accounting file that is specified in the /etc/qconfig file and the file that is created to contain the summary information must grant read and write permissions to the root user or printq group. The pac command generates the summary file name by appending _sum to the path name specified by the acctfile = clause in the /etc/qconfig file. For example, if the qconfig  file reads:

acctfile = /var/adm/1p0acct

The pac command expects the summary file to be named /var/adm/1p0acct_sum.

Flags

Table 1. Flags
Item Description
-c Sorts the output by price instead of alphabetically by user.
-m Groups all the printing charges for a user, regardless of the host machine.
-pPrice Specifies the price, in dollars, charged per unit of output. By default, the system charges $0.02 per units.
-PPrinter Specifies the printer for which accounting records are prepared. By default, the system selects the printer that is named by the PRINTER environment variable or the default value lp0.
Note: When the LPDEST environment variable is set, it takes precedence over the PRINTER environment variable, which has an identical function. Any destination options that are issued from the command line override both the LPDEST and PRINTER environment variables.
-qFile Specifies the queue configuration file. The default value is the /etc/qconfig file.
-r Reverses the sorting order, so that records are sorted alphabetically from z to a, or in descending order by price.
-s Summarizes the accounting information in a summary file. This flag is needed for busy systems.

Examples

  1. To produce printer or plotter accounting information for all users of the lp0 printer, enter:
    /usr/sbin/pac
    The command displays the number of printed pages and the charge, which is sorted by user. This example assumes that there is no PRINTER environment variable.
  2. To collect printer or plotter accounting records in a summary file, enter:
    /usr/sbin/pac  -s
  3. To produce printer or plotter accounting information for smithjones, and greene from the lp12 printer, enter:
    /usr/sbin/pac  -Plp12 smith jones greene
    Note: Do not place a space between a flag and its variable; for example, the -pPrice, -PPrinter, and -qFile.

Files

Table 2. Files
Item Description
/usr/sbin/pac Contains the pac command.
/etc/qconfig Specifies the path to the file.

Security

Attention RBAC users
Attention RBAC users: This command can perform privileged operations. Only privileged users can run privileged operations. For more information about authorizations and privileges, see Privileged Command Database in Security. For a list of privileges and the authorizations that are associated with this command, see the lssecattr command or the getcmdattr subcommand.