使用AWS S3 sync排除多个文件夹 [英] Exclude multiple folders using AWS S3 sync

查看:441
本文介绍了使用AWS S3 sync排除多个文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在使用aws s3 syn时如何排除多个文件夹?

How to exclude multiple folders while using aws s3 syn ?

我尝试过:

# aws s3 sync  s3://inksedge-app-file-storage-bucket-prod-env   s3://inksedge-app-file-storage-bucket-test-env --exclude 'reportTemplate/* orders/* customers/*'

但仍在同步文件夹客户"

But still it's doing sync for folder "customer"

输出:

copy: s3://inksedge-app-file-storage-bucket-prod-env/customers/116/miniimages/IMG_4800.jpg to s3://inksedge-app-file-storage-bucket-test-env/customers/116/miniimages/IMG_4800.jpg
copy: s3://inksedge-app-file-storage-bucket-prod-env/customers/116/miniimages/DSC_0358.JPG to s3://inksedge-app-file-storage-bucket-test-env/customers/116/miniimages/DSC_0358.JPG

推荐答案

最后这对我有用:

aws s3 sync  s3://xxxx-app-file-storage-bucket-prod-env   s3://xxxx-app-file-storage-bucket-test-env --exclude 'customers/*'  --exclude 'orders/*'  --exclude 'reportTemplate/*'  

提示:尤其是必须将通配符和特殊字符括在单引号或双引号中才能正常工作,以下是匹配字符的示例.有关S3命令的更多信息,请在此处amazon 中进行检查./p>

Hint: especially you have to enclose your wildcards and special characters in single or double quotes to work properly, below are example of matching characters. for more information regarding S3 commands, check it in amazon here.

*: Matches everything
?: Matches any single character
[sequence]: Matches any character in sequence
[!sequence]: Matches any character not in sequence

这篇关于使用AWS S3 sync排除多个文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆