SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

Upload Backup Files to Amazon S3

By Alex Marsh,

This script queries msdb for the latest backup file for each user database, of the type specified by the @backupType parameter , and then pushes the file to an Amazon Web Services (AWS) S3 bucket using an embedded PowerShell statement.

Before use the @AWS... variables need to be set with the correct keys, region and bucket name. The AWS PowerShell tools also need to be installed on the server, available from http://aws.amazon.com/powershell/, and xp_cmdshell must be enabled.

The procedure is created with the WITH ENCRYPTION option to protect the access key and secret key.

The script can be easily extended to also cater for differential backups and copying the system database backups as well, and the @AWS... variables could also be parameterised as an option (things that weren't necessary for our scenario).

Total article views: 647 | Views in the last 30 days: 4
 
Related Articles
SCRIPT

Check SQL DB backups details remotely by PowerShell

Check SQL DB backups details remotely by PowerShell

ARTICLE

Powershell Database Backup Script

Learn how to write a script for regular database backups using Powershell and SMO.

ARTICLE

Verify SQL Backups With SQL Powershell

With SQL Powershell, you can check all your database backups in minutes, whether you have ten SQL se...

SCRIPT

PowerShell script to check last backup date for Databases

PowerShell script to check last full backup, transaction log backup date for SQL Server databases.

FORUM

Schedule powershell job

Moving backup files weekly with powershell

Tags
amazon    
aws    
backup    
s3    
 
Contribute