Skip to content
This repository has been archived by the owner on Aug 15, 2023. It is now read-only.

切分运行日志 #673

Open
Arondight opened this issue Feb 25, 2022 · 0 comments
Open

切分运行日志 #673

Arondight opened this issue Feb 25, 2022 · 0 comments
Labels
documentation Improvements or additions to documentation

Comments

@Arondight
Copy link
Owner

Arondight commented Feb 25, 2022

进入本项目所在的目录 ./Adachi-BOT/ 。运行以下命令每小时切分超过 1MiB 的日志,并每月强制切分一次日志。

export PM2_HOME=$(readlink -f ./bot.pm2/)
npx pm2 install pm2-logrotate
npx pm2 set pm2-logrotate:max_size 1M
npx pm2 set pm2-logrotate:retain 1024
npx pm2 set pm2-logrotate:compress false
npx pm2 set pm2-logrotate:dateFormat YYYY-MM-DD_HH-mm-ss
npx pm2 set pm2-logrotate:workerInterval 3600
npx pm2 set pm2-logrotate:rotateInterval '0 0 0 * *'
npx pm2 set pm2-logrotate:rotateModule true
@Arondight Arondight added the documentation Improvements or additions to documentation label Feb 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant