Skip to content

Instantly share code, notes, and snippets.

@fijimunkii
Created February 13, 2018 17:32
Show Gist options
  • Save fijimunkii/61bf2b4d528d519520a5f4fde974771d to your computer and use it in GitHub Desktop.
Save fijimunkii/61bf2b4d528d519520a5f4fde974771d to your computer and use it in GitHub Desktop.
loop through pm2 jlist array
pm2 jlist | jq 'map(.pm_id) | .[]' -r | xargs -I pm_id sh -c '{ pm2 restart pm_id; sleep 5; }'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment