The answer is 'yes' you can do this from scheduler and it's trivial once you know the answer:
- Add a heroku config var with your app name: heroku config:add APP_NAME:blah
- Add gem 'heroku' to your Gemfile
- In order to verify, manually scale up/down your app: heroku ps:scale web=2
Add a rake task to lib/tasks/scheduler.rake:
desc "Scale up dynos"
task :spin_up => :environment do
heroku = Heroku::Client.new('USERNAME', 'PASSWORD')
heroku.ps_scale(ENV['APP_NAME'], :type=>'web', :qty=>2)
# Add a similar task to Spin down
Add the Scheduler addon: heroku addons:add scheduler:standard
- Use the Scheduler web interface to add "rake spin_up" at whatever time you like
- Add a rake spin_down task and schedule it for whenever.
Step 1 is needed because I couldn't find any other way to be certain of the App name (and I use 'staging' and 'production' environments for my apps.
Step 3 is required because otherwise the ruby command errors out as it requires that you first agree (via Yes/No response) that you will be charged money as a result of this action.
In step 4, I couldn't find any docs about how to do this with an API key via the heroku gem, so it looks like user/pass is required.
Hope this helps someone else!