0

I would like to create a script that would make a dump of a postgresql DB on heroku and download it to my local server. I using windows server 2008 R2 and would assume that this would be activated with scheduler. On the local server installed is ruby 1.93 and chocolately (run curl on a PC).

I am assuming that the script would be a ruby file and have the commands to both create a backup and and then use a curl command to download it. The latest backup would be the only one downloaded

The commands would be something like
heroku pgbackups:capture --expire -a appname
curl -o latest.dump heroku pgbackups:url

thanks in advance

6
  • 1
    Easiest way I can think of is to use the Heroku CLI and just run a bunch of command-line calls. Bash would better for that, but you can use back-tics in a ruby file, too. Otherwise, go hunting for gems to interact with Heroku. There should be one or two out there. Commented Jul 22, 2014 at 6:48
  • Hi Narfanator If I can I want to have a script that is automatically started by scheduler with the heroku pgbackups:capture --expire -a appname and curl -o latest.dump heroku pgbackups:url. I have had a look at backtics etc but am not sure what the next step is. thanks Commented Jul 23, 2014 at 2:58
  • You want to look into the Windows bash language, one way or the other. Ruby backtics are a short hand for system calls - stackoverflow.com/questions/6338908/… Commented Jul 23, 2014 at 17:26
  • Heroku tools for windows, including the CLI: toolbelt.heroku.com/windows Commented Jul 23, 2014 at 17:28
  • Your big issue is that the Windows command prompt isn't Unix-based (everything else is, given that everything else consist of Unix distros, Linux distros, and Mac, which is based on Unix). Honestly, if you can run this job on not Windows, that might be easier, especially if you don't have access to anyone who's already familiar with the windows command prompts. Commented Jul 23, 2014 at 17:30

1 Answer 1

1

The easiest way would be to get curl for your Windows machine at http://curl.haxx.se

Sign up to request clarification or add additional context in comments.

1 Comment

Hi sorpaas chocolately works fine for me. thanks

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.