Forrest logo
back to the pm2 tool

pm2:tldr:b1d4c

pm2: Dump all processes for resurrecting them later.
$ pm2 save
try on your machine

The "pm2 save" command is used with the pm2 process manager in Node.js to save the current running processes and configurations.

When you run your application using pm2, it launches and manages multiple processes, and you may have configured certain options for each process. These configurations include things like the number of instances running, environment variables, log file paths, etc.

The "pm2 save" command allows you to persistently save these running processes and configurations so that they can be automatically restarted and reconfigured later. It generates a JSON file called "ecosystem.config.js" which contains all the information about your processes and their configurations.

By running "pm2 save", you ensure that even if the server crashes or is restarted, the previously running applications can be automatically restored and started as per the configurations specified in the ecosystem file. This command essentially saves the current state of your running processes and configurations for future use.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the pm2 tool