Saturday, December 17, 2011

Solaris: Rotating the pacct file

If you happen to have the process accounting (pacct) enabled and the pacct, found under /var/adm to be growing stupendously. You can have it rotated, by means of:

/usr/lib/acct/turnacct switch
This will rename the pacct file to pacct.X, where X is a decimal digit

Or added into cron to rotate at desired interval, daily at midnight for example:
0 0 * * * /usr/sbin/logadm -p now rotate_pacct

Lastly, by mean of logadm, which I'm not covering here, because I'm lazy

No comments: