pm2 添加nodejs项目的自启动

111 阅读1分钟
pm2 start npm --watch --name XXX -- run start

pm2定期删除日志

安装工具pm2 install pm2-logrotate 设置保存7个文件 pm2 set pm2-logrotate-ext:retain 7 设置每个文件大小100m pm2 set pm2-logrotate-ext:max_size 100M