Skip to content

Instantly share code, notes, and snippets.

@ferventcoder
Created December 12, 2012 15:23
Show Gist options
  • Save ferventcoder/4268638 to your computer and use it in GitHub Desktop.
Save ferventcoder/4268638 to your computer and use it in GitHub Desktop.
S3 Backup using CloudBerry's snapin
cinst cloudberryexplorer.s3
$bucket = 'somebucket'
$bucketSubFolder = 'subfolderkey'
$s3AccessKey = $env:AWS_S3__AccessKey
$s3Secret = $env:AWS_S3_Secret
$destinationFolder = "$bucket/$bucketSubFolder"
$localFolder = "C:\Users\user\somefolder"
#http://www.cloudberrylab.com/default.aspx?page=amazon-s3-powershell
Add-PSsnapin cloudberrylab.explorer.pssnapin
$s3 = Get-CloudS3Connection -Key $s3AccessKey -Secret $s3Secret
$destination = $s3 | Select-CloudFolder -Path "$destinationFolder"
$src = Get-CloudFilesystemConnection | Select-CloudFolder "$localFolder"
$src | Copy-CloudSyncFolders $destination -IncludeSubfolders -MissingOnly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment