diff --git a/bin/s3get b/bin/s3get index 054cef0..8c8ec0f 100644 --- a/bin/s3get +++ b/bin/s3get @@ -4,10 +4,15 @@ var program = require('commander') program .version('0.0.1') - .option('-b, --bucket', 'Bucket') + .option('-b, --bucket [name]', 'Bucket') + .option('-p, --prefix [path]', 'Prefix') .parse(process.argv); +// aws-frontend-logs/PROD/access.log/2014/02/22/frontend-router +// var date = moment(new Date()).subtract(moment.duration(2, 'd')).format('YYYY/MM/DD'); +// util.format('PROD/access.log/%s/frontend-router', date) s3get.go({ - bucket: 'aws-frontend-logs' + bucket: program.bucket, + prefix: program.prefix }) diff --git a/lib/aws-parallel-get.js b/lib/aws-parallel-get.js index b194ec2..9f50c59 100644 --- a/lib/aws-parallel-get.js +++ b/lib/aws-parallel-get.js @@ -4,15 +4,13 @@ var AWS = require('aws-sdk') async = require('async'), util = require('util'); - exports.go = function (opts) { AWS.config.loadFromPath('./config.json'); - var s3 = new AWS.S3(); - var bucket = opts.bucket; - var date = moment(new Date()).subtract(moment.duration(2, 'd')).format('YYYY/MM/DD') - , prefix = util.format('PROD/access.log/%s/frontend-router', date) + var s3 = new AWS.S3() + , bucket = opts.bucket + , prefix = opts.prefix; s3.listObjects({ Bucket: bucket,