https://github.com/tarantool/s3
Amazon S3 backup plugin
https://github.com/tarantool/s3
Last synced: 4 months ago
JSON representation
Amazon S3 backup plugin
- Host: GitHub
- URL: https://github.com/tarantool/s3
- Owner: tarantool
- License: other
- Created: 2016-09-23T17:10:17.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2020-10-04T13:31:43.000Z (over 5 years ago)
- Last Synced: 2025-04-21T15:55:06.705Z (about 1 year ago)
- Language: C
- Size: 25.4 KB
- Stars: 5
- Watchers: 34
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Authors: AUTHORS
Awesome Lists containing this project
README
# s3
Amazon S3 backup plugin. Use this plugin to put/get files into amazon s3 storage
### API
* init(opts) (`access` - access key, `secret` - secret key, `region` - amazon region name, `host` - hostname)
* download_file(bucket_name, key, filename)
* upload_file(bucket_name, key, filename)
* list(bucket: optional) - list bucket or service
### Usage
```lua
s3 = require('s3')
-- set credentals, region name and server
s3:init({
access='my_access_key',
secret='my_secret_key',
region='us-east-1',
host='hostname.com'
})
-- download file to current directory from s3 storage
if s3:download_file('files', 'file.txt', 'cloud_file.txt') then
print('download complete')
end
-- upload backup to s3
if s3:upload_file('files', 'backup.txt', '/home/user/backup.txt') then
print('upload complete')
end
print(require('yaml').encode(s3:list()))
---
- name: builds
date: 2016-09-18T15:29:52Z
- name: debrepo
date: 2016-09-18T15:18:30Z
- name: dist
date: 2016-09-28T17:01:47Z
- name: play
date: 2016-09-08T14:22:25Z
- name: test
date: 2016-09-28T17:00:30Z
...
files = s3:list("test")
```
### Building and requirements
* libs3 fork (https://github.com/Sulverus/libs3), depends on libcurl and libxml2