Process by reading the value 1
in the auto-load
file and changing it to 0
after restarting PM2.
node src/index.js <command>
- pm2-restart-all
- pm2-restart [pm2Name]
- pm2-list [pm2Name]
# list PM2 process "pm2 status"
node index.js pm2-list
# restart PM2 "pm2 restart <nnn=pm2_id>"
node index.js pm2-restart myAPI
# restart all PM2 "pm2 restart all"
node index.js pm2-restart-all
# add to crontab for restart every 2 minute
> sudo crontab -e
add -> */2 * * * * node index.js pm2-restart-all