# PM2 使用筆記 * ### 安裝 ``` cmd npm install pm2@latest -g ``` * ### 啟動 ``` cmd pm2 start location/fileName.js --name appName \ --watch true \ --max-memory-restart 500M \ --log ~/.pm2/logs/appName/ \ --time true \ --cron "0 17 * * *" \ --no-daemon true \ --merge-logs ``` ```--name```:指定程序名稱 ```--watch```:檔案有變更時,會自動重新啟動 ```--max-memory-restart```:Memory 使用超過這個門檻時,會自動重啟 ```--log```: * ### 監控 ``` cmd pm2 ls #列出所有應用 pm2 monit #開啟監控畫面 ``` * ### 停止 ```cmd pm2 stop app_name pm2 delete app_name pm2 reload app_name ```
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up