Rotate Log Files

Enhanced PTP User Guide (UG1602)

Document ID
UG1602
Release Date
2023-04-07
Revision
1.1 English

The sfptpdctl logrotate command causes the sfptpd daemon to close and reopen the log file, creating the file if it does not already exist, and overwriting the file if it does already exist.

Note: This command does not move or rename an existing log file.

To ensure any existing log file is kept, do one of the following:

  • Call the sfptpdctl logrotate command from the postrotate section of a standard Linux logrotate configuration file. For example:
    postrotate
        <path>/sfptpdctl logrotate || true
    endscript
  • Move/rename the current log file before invoking the sfptpdctl logrotate command.