Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/upplication/amazons3-files-copier
Node.js module to copy a group of files stored in a bucket or path in AmazonS3 to another bucket or path
https://github.com/upplication/amazons3-files-copier
Last synced: about 8 hours ago
JSON representation
Node.js module to copy a group of files stored in a bucket or path in AmazonS3 to another bucket or path
- Host: GitHub
- URL: https://github.com/upplication/amazons3-files-copier
- Owner: Upplication
- License: mit
- Created: 2014-02-06T09:46:06.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2014-11-19T11:50:36.000Z (almost 10 years ago)
- Last Synced: 2024-11-09T11:08:42.382Z (9 days ago)
- Language: JavaScript
- Homepage:
- Size: 162 KB
- Stars: 2
- Watchers: 10
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
amazons3-files-copier
=====================Process to copy a group of files stored in a bucket or path in AmazonS3 to another bucket or path and optionally backup the contents of the destination path or bucket to another path or bucket.
### Copy method
```js
@param {String|Object} amazonCredentials Two ways:
1. Path to the file where credentials of amazon are stored (Structure example in file 'sample-amazon.json')
2. Object with credentials (Ex.:
{
accessKeyId: 'akid',//required
secretAccessKey: 'secret', //required
sessionToken: 'session', //optional
region: 'region' //optional
}
@param {Object} options. ex.:
{
//required
from:{
BUCKET: 'bucketFrom', //required {String}
path: 'pathFrom' //optional {String}
},
//required
to:{
BUCKET: 'bucketTo', //required {String}
path: 'pathTo' //optional {String}
},
//optional
backup_to:{
BUCKET: 'bucketBackup', //required {String}
path: 'pathBackup' //optional {String}
},
debug: true //optional {Boolean} Print log of each file
}
@returns {Q Promise}```
#### Example```js
var amazonCopier = require('amazons3-files-copier'),
$AMAZON_CREDENTIALS_FILE_PATH = './amazon.json';
amazonCopier.copy($AMAZON_CREDENTIALS_FILE_PATH, {
from:{
BUCKET: 'templater',
path: 'PRE/'
},
to:{
BUCKET: 'templater',
path: 'PRO/'
},
backup_to:{
BUCKET: 'templater-backup',
path: 'PRO/'
},
debug: false
})
.then(function () {
console.log('OK');
}, function (err) {
console.log('Error: ' + err);
});
```