monacct Command
Purpose
Performs monthly or periodic accounting.
Syntax
/usr/sbin/acct/monacct [ -X ] [ Number ]
Description
The monacct command performs monthly or periodic accounting. The intervals are set in the crontab file. You can set the cron daemon to run the monacct command once each month or at some other specified time period. The monacct example shows how to set up this command for use with the cron daemon. See the crontab command for more information about setting up cron files.
The Number parameter indicates which month or other accounting period to process. The default value of the Number parameter is the current month. The monacct command creates summary files in the /var/adm/acct/fiscal file and restarts summary files in the /var/adm/acct/sum file, the cumulative summary to which daily reports are appended.
Note: You should not share accounting files among nodes in a distributed environment. Each node should have its own copy of the various accounting files.
Flags
Item | Description |
---|---|
-X | Processes all available characters for each user name instead of truncating to the first 8 characters. The -X flag will also cause the monacct command to use the /var/adm/acct/sumx and /var/adm/acct/fiscalx directories instead of the /var/adm/acct/sum and /var/adm/acct/fiscal directories. |
Security
Access Control: This command should grant execute (x) access only to members of the administrative group.
Example
To produce automatically a monthly accounting report, add the following to the /var/spool/cron/crontabs/root file:
15 5 1 * * /usr/sbin/acct/monacct
This example shows the instructions that the cron daemon will read and act upon. The monacct command will run at 5:15 (15 5) the first day of each month (1). This command is only one of the accounting instructions normally given to the cron daemon.
Files
Item | Description |
---|---|
/usr/sbin/acct | Contains the accounting commands. |
/var/adm/acct/fiscal | Contains accounting data files. |
/var/adm/acct/sum | Cumulative daily accounting records. |
/var/spool/cron/crontabs | Contains the commands to be run by the cron daemon at regularly scheduled intervals. |