Created
December 2, 2012 20:34
-
-
Save johnnyhalife/4190934 to your computer and use it in GitHub Desktop.
Backup to Azure
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 azure = require('azure'), | |
fs = require('fs'); | |
var container = "mongo-backups" | |
var blobService = azure.createBlobService(); | |
blobService.createContainerIfNotExists(container, {}, function (error) { | |
if(error) return console.error(error); | |
var fileName = process.argv[2]; | |
blobService.createBlockBlobFromFile(container, fileName, fileName, {}, function (error) { | |
if(error) return console.error(error); | |
console.log("successfuly uploaded: %s", fileName); | |
process.exit(0); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment