-
-
Save sbower/68113ad4228bfef3bd237b252c42d689 to your computer and use it in GitHub Desktop.
This file contains 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
var data_stream = new ReadableStream();//new stream.Readable(); | |
var gzip = zlib.createGzip(); | |
// create parameters hash for table scan | |
var params = {TableName: tablename, ReturnConsumedCapacity: 'NONE', Limit: '1'}; | |
// body will contain the compressed content to ship to s3 | |
var body = data_stream.pipe(gzip); | |
var s3obj = new aws.S3({params: {Bucket: 'ccu-dynamo-backups', Key: tablename + '/' + tablename + '-' + ts + '.gz'}}); | |
s3obj.upload({Body: body}). | |
on('httpUploadProgress', function(evt) { | |
console.log(evt); | |
}). | |
send(function(err, data) { console.log(err, data); callback(); }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment