Access to heroku toolbelt commands in a scheduled heroku dyno?

后端 未结 4 1001
礼貌的吻别
礼貌的吻别 2021-01-02 11:04

I want to call heroku postgres backup/restore commands within a scheduled heroku task, but the heroku toolbelt isn\'t available from bash prompt, so I can\'t call heroku com

4条回答
  •  情书的邮戳
    2021-01-02 11:33

    You can use Heroku Scheduler and configure the following command (as an example) to create a database backup:

    curl -s https://s3.amazonaws.com/assets.heroku.com/heroku-client/heroku-client.tgz \
     | tar xz && ./heroku-client/bin/heroku pg:backups:capture -a you-app-name-here
    

    For this to work, you need to add a Config Variable named HEROKU_API_KEY and set its value to the "API Key" value from your Accounts page.

提交回复
热议问题