简体   繁体   中英

PM2 Logrotate does'nt turn every days - configuration

My node application is currently using pm2 for console logging, I need to create a logger that logs warnings and errors only and saves the logs to a log file. It should rotate interval and restarts every day of 01h00. This is my current pm2 config:

 "max_size": "50M",
 "compress": true,
 "rotateInterval": "* * 1 * * *"

This configuration does not rotate every day.

What i missed ?

I think your crontab is wrong, it should be:

  ...
 "rotateInterval": "0 1 * * *"
  ...

You can check https://crontab.guru to try/debug your crontab.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM