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"
}