From 7fb16d2f9a103fe13d9dd1d3c442fd32234eb401 Mon Sep 17 00:00:00 2001 From: Louis Lam Date: Wed, 23 Mar 2022 11:17:23 +0800 Subject: [PATCH] Limit the pm2 log size --- README.md | 8 +++++++- extra/install.batsh | 2 +- install.sh | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 9e170761..3d32ac8c 100644 --- a/README.md +++ b/README.md @@ -61,8 +61,14 @@ npm run setup node server/server.js # (Recommended) Option 2. Run in background using PM2 -# Install PM2 if you don't have it: npm install pm2 -g +# Install PM2 if you don't have it: +npm install pm2 -g && pm2 install pm2-logrotate + +# Start Server pm2 start server/server.js --name uptime-kuma + +# If you want to see the current console output +pm2 monit ``` Browse to http://localhost:3001 after starting. diff --git a/extra/install.batsh b/extra/install.batsh index bca0b095..65e95cd0 100644 --- a/extra/install.batsh +++ b/extra/install.batsh @@ -189,7 +189,7 @@ if (type == "local") { bash("check=$(pm2 --version)"); if (check == "") { println("Installing PM2"); - bash("npm install pm2 -g"); + bash("npm install pm2 -g && pm2 install pm2-logrotate"); bash("pm2 startup"); } diff --git a/install.sh b/install.sh index 37d67531..27b30688 100644 --- a/install.sh +++ b/install.sh @@ -159,7 +159,7 @@ fi check=$(pm2 --version) if [ "$check" == "" ]; then "echo" "-e" "Installing PM2" - npm install pm2 -g + npm install pm2 -g && pm2 install pm2-logrotate pm2 startup fi mkdir -p $installPath