pm2 jlist | node -e 'let s="";process.stdin.on("data",d=>s+=d).on("end",()=>{const ids=JSON.parse(s).filter(p=>p.pm2_env.status==="online").map(p=>String(p.pm2_env.pm_id));if(ids.length)require("child_process").spawnSync("pm2",["restart",...ids],{stdio:"inherit"});else console.log("There is no online process")})'TechnologyTools, Linux
Restart All Online PM2 Processes (Linux)
Restart All Online PM2 Processes (Linux)

Restart All Online PM2 Processes (Linux)
// community
Be the first to comment.