Knowledge base

rotate acct

Rotate accounting files now
Close the accounting file without waiting for midnight

Immediately rotates all configured accounting files, and with a file name — only that one. This does not cancel the automatic midnight rotation.

Needed when the file is taken for processing and the engine must start writing to a new one.

The main trap is taking the file before rotation. Until the file is rotated, the engine keeps writing to it, and a copy taken mid-write ends with a truncated line.
What the Hub does. It does not call it: accounting events arrive as a stream through the webhook, and “Accounting stats” reads the files in place without rotating them.
Recommended values

When to use it:

Question This command or not
close the current accounting file for processing yes
rotate the log no — rotate log
The action, selecting one file and keeping the midnight rotation come from the manual (§ 6.3.9). The trap analysis is ours.
Example configuration
# rotate all accounting files
pmta rotate acct
The reply is “Accounting file rotated.”.
yellow — — directive names, blue — blocks. They are highlighted the same way in the text of the card.
Compatibility
PowerMTA 6.0
described in the manual of this version · platform: any
The vendor does not state the first version for every directive — there is no note here. The name also appears in the 5.0 edition of the manual.
How to check on the node
Make sure the current file has been started anew:
ls -lt /var/log/pmta/ | head
The new current file starts from scratch; where the previous one goes is decided by the rotation settings in the <acct-file> block.
In the Hub
Cost of a mistake
safe: a wrong value breaks nothing
Scenarios
Collect telemetry