AWS CLI S3同步从阵列中排除文件夹

问题描述

我具有以下PowerShell代码,用于从文件夹传输文件并排除某些文件夹。我将排除的文件夹传递给数组,但这不起作用。

$websitebucket="test"

  
function websitesync($sourcesite,$destinationsite,$exclude){

 $complist=$exclude
foreach($comp in $complist){
       
   $comparray += " --exclude="   + """$comp"""   
   
}
$comparray

aws s3 sync $sourcesite s3://$websitebucket/$destinationsite $comparray   

}

websitesync -sourcesite "D:\tmp\s3test" -destinationsite "bucket" -exclude '/log/*','csv/*','Log/*'

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)