Skip to content

Instantly share code, notes, and snippets.

@lrhache
Last active December 26, 2015 22:19
Show Gist options
  • Save lrhache/7221971 to your computer and use it in GitHub Desktop.
Save lrhache/7221971 to your computer and use it in GitHub Desktop.
Command line helper to find and stop all manually initiated process on Heroku.

One of my automated process starts dynos when he feels he need more juice in the pipes. But, while running tests, something failed and just kept 10 or more dynos running. It's a pain to stop those manually.

Here's a simple command line that can be executed to stop all running dynos except those initiated at runtime or in via the Procfile.

heroku ps -a <HEROKU_APP> | grep -o -P '(run\.[0-9]+)' | while read line ; do heroku ps:stop $line -a <HEROKU_APP> ; done

Of course, replace <HEROKU_APP> with the name of your app.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment