1

How to enable on the "daily" rotation. I need to rotate the logs strictly at 00:00 every day. There is no word about it in the documentation, or i dont understand something.

I have service installation script "install.bat" in which all the parameters related to log rotation:

...
nssm set Server%SNAME% AppStdout C:\Server%SNAME%\Logs\server.log
nssm set Server%SNAME% AppStderr C:\Server%SNAME%\Logs\server.log
nssm set Server%SNAME% AppStdoutCreationDisposition 4
nssm set Server%SNAME% AppStderrCreationDisposition 4
nssm set Server%SNAME% AppRotateFiles 1
nssm set Server%SNAME% AppRotateOnline 1
nssm set Server%SNAME% AppRotateSeconds 86400
nssm set Server%SNAME% AppRotateBytes 52428800
...

the only thing I came up with is calling, from another service, the rotation command:

nssm rotate %Server%SNAME%

and it works, but I think there are better options.

How else to rotate nssm logs every day at a strict time?

AviK
  • 19
  • 1

2 Answers2

0

No, I don't think it's in capabilities of NSSM. You can specify time between rotations, but it's related to time, since the service is running. It's not cron-like record.

0

Bit of a hack, but... You can use Windows Task Scheduler and create there new "Basic Task" that triggers daily at specified time and set Action for it to "nssm rotate <service_name>". Check "Task" there. It has more sophisticated control of conditions and settings.

SeO
  • 151
  • 1
  • 6