PowerShell script for log rotation

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
  • what are you trying to achieve
  • what have you tried so far to achieve this

SonarQube Version - 8.9
SonarQube Edition - Enterprise

We have set the log rotation in monthly basis in Sonar properties file -

sonar.log.rollingPolicy=time:yyyy-MM sonar.log.maxFiles=0

At the end of every month, we take the back-up of log files manually . Is there any script available for this to be automate.

If there is some PowerShell script for this. Please provide me.