Skip to content

Log Functions

🛠️ Tools · ⬅ Home


Rotation

Usage

rotateLog [ --dry-run ] logFile count

Rotate a log file Backs up files as: logFile logFile.1 logFile.2 logFile.3 But maintains file descriptors for logFile.

Arguments

  • --dry-run - Flag. Optional. Do not change anything.
  • logFile - Required. A log file which exists.
  • count - Required. Integer of log files to maintain.

Return codes

  • 0 - Success
  • 1 - Environment error
  • 2 - Argument error

Usage

rotateLogs [ --dry-run ] logPath count

For all log files in logPath with extension .log, rotate them safely

Arguments

  • --dry-run - Flag. Optional. Do not change anything.
  • logPath - Required. Path where log files exist.
  • count - Required. Integer of log files to maintain.

Return codes

  • 0 - Success
  • 1 - Environment error
  • 2 - Argument error