Best option to transfer a file from a windows server to s3 on a schedule

0

Best option to transfer a file from a windows server to s3 on a daily basis. The files size are in MB, need to select the files available in the last 24hours and upload to S3.

Is AWS Transfer for SFTP a good option? Cyberduck or duck cli?

Is there any third party tool that does this? To scan the files available on a server in last 24 hours and upload to S3?

1개 답변
0
수락된 답변

Have you thought about running a powershell script via windows task scheduler to scan for new files in the last 24 hours and to issue a aws s3 cp command to an S3 bucket?

Ensure the EC2 has appropiate policy to allow access to the S3 bucket.

Its simple but effective

Script I just wrote to monitor folders and copy files created within 1 day. If need be you can change CreationTime to another file variable such as written time or modified time.

$folderstomonitor = @("C:\users\myuser\Downloads","c:\temp")
$bucketname = "s3://mybucketbucket/"

foreach ($folder in $folderstomonitor) {
	$filetocopy = Get-ChildItem -Path $folder -Recurse -File | Where-Object {$_.CreationTime -gt (Get-Date).AddDays(-1)} | % { $_.FullName }
        cmd.exe /c "aws s3 cp $filetocopy $bucketname"
}
profile picture
전문가
답변함 6달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠