Comment 2 for bug 1530167

Revision history for this message
Dmitry Teselkin (teselkin-d) wrote :

It is possible to use custom accounting file, passing it to atop via ATOPACCT environment variable (from man [1]):

---
With the environment variable ATOPACCT the name of a specific process accounting file can be specified (accounting should have been activated on beforehand). When this environment variable is present but its contents is empty, process accounting will not be used at all.
---

However, it's not that simple - it works as expected only when ATOPACCT set to empty variable - in this case accounting disabled. To collect accounting data in custom file additional actions required:
* file must be created first
* accounting must be turned on manually
* path to custom accounting file must be passed to atop via ATOPACCT environment varialble
* when atop stopped accounting must be turned off manually

In ubuntu 'accton' command (from package 'acct') is used to enable/disable accounting.

I'm attaching simple wrapper that automates all the step above.

[1] http://linux.die.net/man/1/atop