October 20, 2014 at 9:12 am
Comments posted to this topic are about the item Upload Backup Files to Amazon S3
February 28, 2017 at 6:05 am
Alex Marsh - Monday, October 20, 2014 9:12 AMComments posted to this topic are about the item Upload Backup Files to Amazon S3
Hi! thank you for you script, it helps a lot in my issue.
I have had a problem, It doesn't load by default the AWSPowerShell module (you can modify your ps profile for loading it,but...) .
I decide to create an script with params
* Create CopyFilesToS3.ps1
param([string]$BucketName="?",[string]$AccessKey="?",[string]$secretKey="?",[string]$region="?",[string]$filename="?")
Set-ExecutionPolicy RemoteSigned
Import-Module "{your-path}\AWSPowerShell.psd1"
Write-S3Object -BucketName $BucketName -AccessKey $AccessKey -secretKey $secretKey -Region $region -File $filename -key $filename
And call it
SET @cmd = 'powershell .\CopyFilesToS3.ps1'
SET @cmd += ' -BucketName "' + @AWSbucketName;
SET @cmd += '" -AccessKey "' + @AWSAccessKey;
SET @cmd += '" -secretKey "' + @AWSSecretKey;
SET @cmd += '" -Region "' + @AWSregion;
SET @psCmd = @cmd + '" -File "' + @fileName + '" -key "' + @fileName+'"';
exec xp_cmdshell @psCmd;
January 27, 2019 at 1:52 pm
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy