1

I'm trying to have my dynos restarted every 2 hours or so. I don't have a CLI connection installed or anything like that, I'd like to do this directly in the web interface with Heroku Scheduler.

The web interface has a "Run console" option in the "More" menu. screenshot of the "Run console" input

If I try to run the heroku ps:restart command there, it says:

bash: heroku: command not found

It's the same result if I try to run just ps:restart. And the same result if I put either of those in the Heroku Scheduler.

Is there a way for me to achieve this with Heroku Scheduler? Without setting up extra scripts and authorizations etc. as described here: Schedule Heroku to restart dynos every 10 or so minutes

  • Sidenote: from my experience you should invest time to fix the root problem, not just restart servers to fix it. (assuming it's a bug / memory problem / ...) – Denis Cornehl Nov 23 '19 at 08:27
  • Thanks – I'm sure that's the right way to go, but I can't figure out the memory problems & my use case would allow for an hourly restart so conveniently :) – Martti Heikkilä Nov 27 '19 at 09:55

1 Answers1

2

The default dyno image doesn't have the Heroku CLI installed. But there is a buildpack you can add on top of your current language buildpack, and you'll have the heroku command in your app.

Denis Cornehl
  • 4,104
  • 1
  • 20
  • 24