You are viewing a single comment's thread from:

RE: How to use PM2 to manage your scripts

in #linux6 years ago

I was using tmux. PM2 looks like this is a better solution for me since my scripts tend to fail a lot. I really like the auto-restart feature.

Just to clarify, does pm2 savework as an auto-restart when script stops working due to various errors?

Sort:  

pm2 save saves the current state of your scripts. You might have some scripts handled under pm2 but stopped and some running. It will keep track of that for you and upon reboot, they will be in the same state.

pm2 save has nothing to do with auto-restart, that will happen automatically after doing a pm2 start

I use tmux a lot as well for single processes. It's a shame it isn't as easy to log as screen but I like it far better.