Search code examples
pythonnode.jsubuntupm2

Create PM2 Ecosystem File from current processes


I'm running a few programs (NodeJS and python) in my server (Ubuntu 20.04). I use PM2 CLI to create and manage processes. Now I want to manage all process through an echo system file. But when I run pm2 ecosystem, it just creates a sample file. I want to save my CURRENT PROCESSES to the echo system file and modify it. Anyone know how to save pm2 current process as echo system file?


Solution

  • If you use pm2 startup pm2 creates a file named ~/.pm2/dump.pm2 with all running processes (with too many parameters, as it saves the whole environment in the file)

    Edit: This file is similar to the output of the command pm2 prettylist