# How to retrieve data from Amazon AWS:S3 programmatically

**URL:** <https://www.ruby-forum.com/t/how-to-retrieve-data-from-amazon-aws-s3-programmatically/114199>\
**Category:** Rails\
**Created:** [September 9, 2007, 4:51pm UTC](https://www.ruby-forum.com/t/how-to-retrieve-data-from-amazon-aws-s3-programmatically/114199 "2007-09-09T16:51:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dorelal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/3da27b/32.png) [@dorelal](https://www.ruby-forum.com/u/dorelal)\
**Post date:** [September 9, 2007, 4:51pm UTC](https://www.ruby-forum.com/t/how-to-retrieve-data-from-amazon-aws-s3-programmatically/114199/1 "2007-09-09T16:51:25Z")

</div>

I store all uploaded images at file system.

Once a week I backup all the data to aws:s3 . Let’s say that the url  
where  
the data is stored is

[http://s3.amazonaws.com/foo/images.tar.gz](http://s3.amazonaws.com/foo/images.tar.gz)

On my staging server I want to retrieve this data to verify that the  
backup  
is indeed good.

My question is how to retrieve images.tar.gz programmatically.

Similarly I also backup the production database data to s3 and I want to  
retrieve that data programmatically too. This data is available as  
[http://s3.amazonaws.com/foo/production\_dump\_2007-09-04\_00-00-14.sql.gz](http://s3.amazonaws.com/foo/production_dump_2007-09-04_00-00-14.sql.gz)

Thanks.

---

<div class="post-metadata">

**Author:** ![dorelal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/3da27b/32.png) [@dorelal](https://www.ruby-forum.com/u/dorelal)\
**Post date:** [September 10, 2007, 11:31pm UTC](https://www.ruby-forum.com/t/how-to-retrieve-data-from-amazon-aws-s3-programmatically/114199/2 "2007-09-10T23:31:52Z")

</div>

I use the s3sync library to do similar tasks. Very easy to use…  
check out the README for s3cmd  
[http://s3sync.net/wiki](http://s3sync.net/wiki)

---

<div class="post-metadata">

**Author:** ![dorelal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/3da27b/32.png) [@dorelal](https://www.ruby-forum.com/u/dorelal)\
**Post date:** [September 12, 2007, 10:39am UTC](https://www.ruby-forum.com/t/how-to-retrieve-data-from-amazon-aws-s3-programmatically/114199/3 "2007-09-12T10:39:41Z")

</div>

Thanks. I’ll try that.
