Last active
December 21, 2015 06:09
-
-
Save belisarius222/6261980 to your computer and use it in GitHub Desktop.
little script to download files sequentially from an S3 bucket. This will download all the mongo binaries into the same directory as the script.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import requests | |
| filenames = [ | |
| 'doxygenConfig', | |
| 'firstExample', | |
| 'secondExample', | |
| 'SConstruct', | |
| 'mongod', | |
| 'mongo', | |
| 'mongodump', | |
| 'mongorestore', | |
| 'test', | |
| 'perftest', | |
| 'mongostat', | |
| 'mongofiles', | |
| 'mongoimport', | |
| 'mongoexport', | |
| 'mongooplog', | |
| 'mongotop', | |
| 'bsondump', | |
| 'mongoperf', | |
| 'mongos', | |
| 'rsExample', | |
| 'clientTest', | |
| 'tutorial', | |
| 'whereExample', | |
| 'authTest', | |
| 'httpClientTest', | |
| 'bsondemo', | |
| 'mongo_astyle', | |
| 'node' | |
| ] | |
| base_url = 'https://bbb-binaries.s3.amazonaws.com' | |
| for filename in filenames: | |
| with open(filename, 'wb') as handle: | |
| url = base_url+'/'+filename | |
| print 'Downloading from: '+url | |
| request = requests.get(url, stream=True) | |
| for block in request.iter_content(1024): | |
| if not block: | |
| break | |
| handle.write(block) | |
| print 'Finished download.' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment