I am using pm2 to start my app but i am not able to pass argument to it. the command I am using is pm2 start app.js -- dev. Though this works with forever.
I always use PM2 to run my python scripts in Linux environment. So consider a script has a single parameter and needs to run continously after some amount if time, then we can pass it like this:
pm2 start --name --interpreter --restart-delay --
filename.py
is Name of the python script, without <> symbols, I want to run using PM2
nameForJob
is the Meaningful name for the job, without <> symbols
InterpreterName
is the python interpreter for running script, usually it is python3
in linux
timeinMilliseconds
is the time our script needs to wait and re-run again
param1
is the first parameter for the script
param2
is the second parameter for the script.