use aws-cli to upload box backups

This commit is contained in:
Girish Ramakrishnan
2016-04-10 18:00:30 -07:00
parent be127ec313
commit 4565291c1c
4 changed files with 23 additions and 30 deletions
+1 -11
View File
@@ -67,17 +67,7 @@ function getBackupUrl(apiConfig, filename, callback) {
getBackupCredentials(apiConfig, function (error, credentials) {
if (error) return callback(error);
var s3 = new AWS.S3(credentials);
var params = {
Bucket: apiConfig.bucket,
Key: apiConfig.prefix + '/' + filename,
Expires: 60 * 60 /* 60 minutes */
};
var url = s3.getSignedUrl('putObject', params);
callback(null, { url: url, id: filename });
callback(null, credentials);
});
}