aaP_jfxprofit Hi, everyone, hope someone can help me If my app.js is locate at www folder and i want to restart pm2 every 5hours, how do i set it to cron? Regards, Jason
kardo95 When you run pm2 restart all in command line what will happen? Can you output the message when you run it?
aaP_jfxprofit kardo95 Hi, kardo, im having bugs with pm2 restart app --cron-restart="0 */5 * * *" it keep unstable restart error. so i have to stop use it.
kardo95 It means there is a problem with your node app, you can see if your pm2 is working correctly or not by running this command pm2 ls
aaP_jfxprofit kardo95 Yes, its online. but right now i cannot use "restart" in pm2. i only can pm2 stop / delete or kill if not the app will keep restarting , and my cpu usage become 100%. Thats why i need to find out how to set auto restart from aapanel cron tab
aaPanel_Kern aaP_jfxprofit Hi, maybe you should check what the code is using cpu 100%. Restart and try the following command: where www is your startup user 2 is your project name, change it according to your actual content source /root/.profile pm2 -u www restart 2
aaP_jfxprofit aaPanel_Kern 不明白。@@. 我是用 terminal npm i pm2 -g 进行安装的。 我每次都要去terminal, pm2 restart app。 如果aapanel cron 可以的话,我就方便很多