0 reading now0 total views
Home›Technology›Tools, Linux›Restart All Online PM2 Processes (Linux)

Restart All Online PM2 Processes (Linux)

Restart All Online PM2 Processes (Linux)

Restart All Online PM2 Processes (Linux)
Restart All Online PM2 Processes (Linux)
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")})'
// community

Comments 0

Be the first to comment.